package bug; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.web.HTMLEditor; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class Bug extends Application { public final static String TEST_PANE_ID = "TestPane"; public final static String RESET_BUTTON_TXT = "sout"; public final static String RESET_BUTTON_ID = "reset.btn"; VBox root = new VBox(5); VBox content = new VBox(); HTMLEditor editor = null; public static void main(String[] args) { launch(Bug.class, args); } @Override public void start(Stage stage) throws Exception { stage.setScene(new MenuBarAppScene()); stage.show(); } public class MenuBarAppScene extends Scene { public MenuBarAppScene() { super(root = new VBox(5)); root.setOnKeyPressed(new EventHandler() { public void handle(KeyEvent ke) { if (ke.isControlDown() && ke.isShiftDown() && ke.getCode() == KeyCode.H) { System.out.println(((HTMLEditor) content.getChildren().get(0)).getHtmlText()); } } }); content = new VBox(); content.setId(TEST_PANE_ID); content.setPrefSize(600, 400); content.setMinSize(600, 400); content.setMaxSize(600, 400); editor = new HTMLEditor(); content.getChildren().add(editor); Button clear_btn = new Button(RESET_BUTTON_TXT); clear_btn.setOnAction(new EventHandler() { public void handle(ActionEvent t) { sout(); } }); clear_btn.setId(RESET_BUTTON_ID); root.getChildren().add(content); root.getChildren().add(clear_btn); } protected void sout() { System.out.println(editor.getBoundsInLocal()); System.out.println(editor.getBoundsInParent()); } } }