changeset 6526:5852ce9869cd

RT-35618 IMX6-SDP / Yocto hard float : hello.HelloButton : the highlighting blue rectangle is missing the bottom blue line in each of the top two buttons Reviewed-by : kselle, dblaukopf
author Rafi Tayar <rafi.tayar@oracle.com>
date Thu, 20 Mar 2014 11:35:04 +0200
parents 492c42c21d9f
children a0a619f9f425
files apps/toys/Hello/src/main/java/hello/HelloButton.java
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/apps/toys/Hello/src/main/java/hello/HelloButton.java	Thu Mar 20 13:52:40 2014 +0400
+++ b/apps/toys/Hello/src/main/java/hello/HelloButton.java	Thu Mar 20 11:35:04 2014 +0200
@@ -44,28 +44,28 @@
     @Override public void start(Stage stage) {
         stage.setTitle("Hello Button");
         Scene scene = new Scene(new Group(), 600, 450);
-        Button button = new Button();
-        button.setText("Click Me");
-        button.setLayoutX(25);
-        button.setLayoutY(40);
+        Button button1 = new Button();
+        button1.setText("Click Me");
+        button1.setLayoutX(25);
+        button1.setLayoutY(40);
 
-        button.setOnAction(e -> System.out.println("Event: " + e));
+        button1.setOnAction(e -> System.out.println("Event: " + e));
 
-        button.addEventHandler(KeyEvent.KEY_RELEASED, e -> System.out.println("Event: " + e));
+        button1.addEventHandler(KeyEvent.KEY_RELEASED, e -> System.out.println("Event: " + e));
 
-        ((Group)scene.getRoot()).getChildren().add(button);
+        ((Group)scene.getRoot()).getChildren().add(button1);
 
-        button = new Button();
-        button.setText("Click Me Too");
-        button.setLayoutX(25);
-        button.setLayoutY(70);
-        ((Group)scene.getRoot()).getChildren().add(button);
+        Button button2 = new Button();
+        button2.setText("Click Me Too");
+        button2.setLayoutX(25);
+        button2.layoutYProperty().bind(button1.heightProperty().add(button1.layoutYProperty()));
+        ((Group)scene.getRoot()).getChildren().add(button2);
 
-        button = new Button();
-        button.setText("Click Me Three");
-        button.setLayoutX(25);
-        button.setLayoutY(100);
-        ((Group)scene.getRoot()).getChildren().add(button);
+        Button button3 = new Button();
+        button3.setText("Click Me Three");
+        button3.setLayoutX(25);
+        button3.layoutYProperty().bind(button2.heightProperty().add(button2.layoutYProperty()));
+        ((Group)scene.getRoot()).getChildren().add(button3);
 
         stage.setScene(scene);
         stage.show();