0 Replies Latest reply on Sep 3, 2013 1:07 PM by wzberger

    Right Aligned ToolBar Control - Spacer issue


      When adding a right aligned control to a toolbar I have to add a sping/spacer as described here - however, when an overflow button appears the spacer component is selectable in the overflow popup menu. Is there any way to avoid this behavior? The test below demonstrates the issue.



      //see: http://www.oracle.com/technetwork/articles/java/javafxbest2-1634274.html
      //section: Implementing Springs and Struts in the UI
      public class ToolBarOverflowTest extends Application
        public static void main(String[] args)
          Application.launch(ToolBarOverflowTest.class, args);
        public void start(Stage stage)
          ToolBar toolBar = new ToolBar();
          for (int i = 1; i<6; i++)
            toolBar.getItems().add(new Button("ToolBarButton " + i));
          Region spring = new Region();
          HBox.setHgrow(spring, Priority.ALWAYS);       
          toolBar.getItems().add(new Button("Right ToolBarButton"));   
          BorderPane root = new BorderPane();
          Scene scene = new Scene(root, 400, 300);