import javafx.application.Application; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.input.MouseEvent; import javafx.scene.layout.VBox; import javafx.scene.web.HTMLEditor; import javafx.stage.Stage; public class testhtmleditor extends Application { HTMLEditor htmlview = null; public void start(Stage stage) { stage.setTitle("test HTMLEditor"); stage.setResizable(false); Scene scene = new Scene(new Group(), 600, 400); stage.setScene(scene); Group root = new Group(); scene.setRoot(root); VBox vbox = new VBox(); Button btn = new Button("Set HTML"); btn.setOnMouseReleased(new EventHandler() { public void handle(MouseEvent me) { htmlview.setHtmlText(" " + " HTMLEditor " + " " + " " + " test HTMLEditor" + " " +""); } }); htmlview = new HTMLEditor(); vbox.getChildren().addAll(btn,htmlview); root.getChildren().add(vbox); stage.setVisible(true); } public static void main(String[] args) { Application.launch(args); } }