Reputation: 793
I have problems with my JavaFX TreeTableView. In one case, I have > 100 columns and here the problem is worst. I am using JDK 8u121x64.
When having many columns, the scrollbar is calculated wrong and cutting of the last column. Here is a SSCCE
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.control.TreeTableView;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TreeTableViewScroll extends Application {
public static void main(final String[] args) {
launch(args);
}
@Override
public void start(final Stage primaryStage) throws Exception {
final Scene scene = createScene();
primaryStage.setTitle("Tree Table View Scroll");
primaryStage.setScene(scene);
primaryStage.show();
}
private Scene createScene() {
final VBox vBox = new VBox();
vBox.setPadding(new Insets(5));
vBox.setSpacing(5);
final TreeTableView<String> resultsTable = new TreeTableView<>();
resultsTable.setShowRoot(false);
final TreeItem<String> rootItem = new TreeItem<>();
resultsTable.setRoot(rootItem);
for (int i = 0; i < 200; i++) {
final TreeTableColumn<String, String> dummyColumn = new TreeTableColumn<>("Long Column name " + i);
resultsTable.getColumns().add(dummyColumn);
}
final TreeTableColumn<String, String> nameColumn = new TreeTableColumn<>("Name_very long column text");
resultsTable.getColumns().add(nameColumn);
vBox.getChildren().setAll(resultsTable);
VBox.setVgrow(resultsTable, Priority.ALWAYS);
vBox.setPrefSize(800, 600);
for (int i = 0; i < 50; i++) {
final TreeItem<String> newItem = new TreeItem<>("Text " + i);
rootItem.getChildren().add(newItem);
newItem.getChildren().add(new TreeItem<>("Text " + i));
}
return new Scene(vBox);
}
}
What am I missing? Or is this a framework bug? And if, where do I file the bug?
Upvotes: 0
Views: 477
Reputation: 1666
This is a Issue in JDK8, where as i could see the expected result in JDK9 ea build You should file issue with java - http://bugreport.java.com/submit_intro.do
Upvotes: 1