changeset 6247:d826d56a1704

Simplifying HelloPagination (and fixing a layout bug that may be what is being reported in RT-35617).
author jgiles
date Wed, 05 Feb 2014 13:45:55 +1300
parents 6deeda41145d
children 412d028f5f5f
files apps/toys/Hello/src/main/java/hello/HelloPagination.java
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/apps/toys/Hello/src/main/java/hello/HelloPagination.java	Tue Feb 04 15:47:08 2014 -0500
+++ b/apps/toys/Hello/src/main/java/hello/HelloPagination.java	Wed Feb 05 13:45:55 2014 +1300
@@ -35,6 +35,7 @@
 import javafx.scene.control.Label;
 import javafx.scene.layout.AnchorPane;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.Priority;
 import javafx.scene.layout.VBox;
 import javafx.stage.Stage;
 import javafx.util.Callback;
@@ -197,16 +198,10 @@
                 getCurrentPageIndex);
 
         HBox box = new HBox(10);
-        box.getChildren().addAll(toolbar);
-        AnchorPane anchor = new AnchorPane();
-        AnchorPane.setTopAnchor(box, 10.0);
-        AnchorPane.setLeftAnchor(box, 10.0);
-        AnchorPane.setTopAnchor(pagination, 10.0);
-        AnchorPane.setRightAnchor(pagination, 10.0);
-        AnchorPane.setBottomAnchor(pagination, 10.0);
-        AnchorPane.setLeftAnchor(pagination, 250.0);
-        anchor.getChildren().addAll(box, pagination);
-        Scene scene = new Scene(anchor, 800, 600);
+        HBox.setHgrow(pagination, Priority.ALWAYS);
+        box.getChildren().addAll(toolbar, pagination);
+
+        Scene scene = new Scene(box, 800, 600);
         stage.setScene(scene);
         stage.show();
     }