-
Bug
-
Resolution: Unresolved
-
P4
-
jfx11, 8u251, jfx15
raised in question at SO (https://stackoverflow.com/q/64769593/203657)
To reproduce, compile and run, note the blue focus marker
- expected: marker on first item (or no showing at all)
- actural: marker on second item
happens if
- !showRoot
- treeItems added one-after-the-other to root children (with root already attached to tree)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class App extends Application {
@Override
public void start(Stage stage) {
TreeView<String> treeView = new TreeView<>();
TreeItem<String> root = new TreeItem<>("Root");
treeView.setRoot(root);
treeView.setShowRoot(false);
root.getChildren().add(new TreeItem<>("Foo"));
root.getChildren().add(new TreeItem<>("Bar"));
root.getChildren().add(new TreeItem<>("Baz"));
var scene = new Scene(new StackPane(treeView), 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
To reproduce, compile and run, note the blue focus marker
- expected: marker on first item (or no showing at all)
- actural: marker on second item
happens if
- !showRoot
- treeItems added one-after-the-other to root children (with root already attached to tree)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class App extends Application {
@Override
public void start(Stage stage) {
TreeView<String> treeView = new TreeView<>();
TreeItem<String> root = new TreeItem<>("Root");
treeView.setRoot(root);
treeView.setShowRoot(false);
root.getChildren().add(new TreeItem<>("Foo"));
root.getChildren().add(new TreeItem<>("Bar"));
root.getChildren().add(new TreeItem<>("Baz"));
var scene = new Scene(new StackPane(treeView), 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}