/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. */ package helloworld; import java.util.logging.Level; import java.util.logging.Logger; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; /** * * @author jcambon */ public class TestLayoutBug extends Application { @FXML private Button b1; /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(TestLayoutBug.class, (java.lang.String[]) null); } @Override public void start(Stage primaryStage) { try { AnchorPane page = (AnchorPane) FXMLLoader.load(TestLayoutBug.class.getResource("layout-bug.fxml")); Scene scene = new Scene(page); primaryStage.setScene(scene); primaryStage.setTitle("Layout bug"); primaryStage.show(); } catch (Exception ex) { Logger.getLogger(TestLayoutBug.class.getName()).log(Level.SEVERE, null, ex); } } @FXML void moveB1(ActionEvent event) { System.out.println("Moving Button b1..."); b1.setLayoutX(70); b1.setLayoutY(49); } }