I'm running on javafx.runtime.version=8.0.0-ea-b103
With this simple application :
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane borderPane = new BorderPane();
ToolBar toolbar = new ToolBar();
Button button = new Button("Test");
button.setId("mybutton");
toolbar.getItems().add(button);
//borderPane.setCenter(button);
borderPane.setTop(toolbar);
System.out.println("MyButton = " + borderPane.lookupAll("#mybutton"));
Scene scene = new Scene(borderPane, 1024, 768);
primaryStage.setScene(scene);
primaryStage.show();
System.out.println("MyButton = " + borderPane.lookupAll("#mybutton"));};
}
When the button is inside a toolbar, the first lookupAll return an empty set.
The second lookup work.
When the button is directly in the border pane, all lookup work.
With this simple application :
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane borderPane = new BorderPane();
ToolBar toolbar = new ToolBar();
Button button = new Button("Test");
button.setId("mybutton");
toolbar.getItems().add(button);
//borderPane.setCenter(button);
borderPane.setTop(toolbar);
System.out.println("MyButton = " + borderPane.lookupAll("#mybutton"));
Scene scene = new Scene(borderPane, 1024, 768);
primaryStage.setScene(scene);
primaryStage.show();
System.out.println("MyButton = " + borderPane.lookupAll("#mybutton"));};
}
When the button is inside a toolbar, the first lookupAll return an empty set.
The second lookup work.
When the button is directly in the border pane, all lookup work.