Hi,
I have a MenuBar and a TreeView control. I focus the root node in the TreeView and press the down key. Instead of navigating through the tree, the MenuBar popups up the first MenuItem, although the TreeView had focus.
If there is no MenuBar, the TreeView behaves as expected. The up key always works.
I use JFX 2.1 Developer Preview b08.
See this code for a sample:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp3 extends Application {
public static void main(String[] args) throws Exception {
launch(args);
}
public void start(final Stage stage) throws Exception {
VBox root = new VBox();
MenuBar menuBar = new MenuBar();
Menu menu = new Menu("Test");
menu.getItems().add(new MenuItem("Bla"));
menuBar.getMenus().add(menu);
TreeItem<String> treeItem1 = new TreeItem<String>();
treeItem1.setValue("test1");
TreeItem<String> treeItem2 = new TreeItem<String>();
treeItem2.setValue("test2");
TreeView<String> treeView = new TreeView<String>();
TreeItem<String> treeRoot = new TreeItem<String>("Root");
treeView.setRoot(treeRoot);
treeRoot.getChildren().add(treeItem1);
treeRoot.getChildren().add(treeItem2);
root.getChildren().add(menuBar);
root.getChildren().add(treeView);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
I have a MenuBar and a TreeView control. I focus the root node in the TreeView and press the down key. Instead of navigating through the tree, the MenuBar popups up the first MenuItem, although the TreeView had focus.
If there is no MenuBar, the TreeView behaves as expected. The up key always works.
I use JFX 2.1 Developer Preview b08.
See this code for a sample:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp3 extends Application {
public static void main(String[] args) throws Exception {
launch(args);
}
public void start(final Stage stage) throws Exception {
VBox root = new VBox();
MenuBar menuBar = new MenuBar();
Menu menu = new Menu("Test");
menu.getItems().add(new MenuItem("Bla"));
menuBar.getMenus().add(menu);
TreeItem<String> treeItem1 = new TreeItem<String>();
treeItem1.setValue("test1");
TreeItem<String> treeItem2 = new TreeItem<String>();
treeItem2.setValue("test2");
TreeView<String> treeView = new TreeView<String>();
TreeItem<String> treeRoot = new TreeItem<String>("Root");
treeView.setRoot(treeRoot);
treeRoot.getChildren().add(treeItem1);
treeRoot.getChildren().add(treeItem2);
root.getChildren().add(menuBar);
root.getChildren().add(treeView);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}