-
Bug
-
Resolution: Unresolved
-
P3
-
jfx20, jfx21, jfx22, jfx23
ADDITIONAL SYSTEM INFORMATION :
win10
jdk17
javafx 21
A DESCRIPTION OF THE PROBLEM :
I encountered a strange bug while using the TableView component in JavaFX. To reproduce this bug, the following conditions need to be met:
1. The horizontal scrollbar of the TableView needs to appear.
2. The vertical scrollbar of the TableView needs to appear, but this scrollbar should be non-scrollable.
3. When you scroll down using the mouse wheel and then click on the table, some data inside the table disappears.
However, I monitored the `itemsProperty()` of the TableView and did not find any changes in the elements.
Environment:
- JDK 17
- JavaFX 21
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. The horizontal scrollbar of the TableView needs to appear.
2. The vertical scrollbar of the TableView needs to appear, but this scrollbar should be non-scrollable.
3. When you scroll down using the mouse wheel and then click on the table, some data inside the table disappears.
---------- BEGIN SOURCE ----------
package org.example;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.util.Callback;
import java.util.HashMap;
import java.util.Map;
public class TestTableView extends Application {
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
TableView<Map> tableView = new TableView<>();
int size = 10;
for (int i = 0; i < size; i++) {
TableColumn<Map,String> tableColumn = new TableColumn<>(i+"");
int finalI = i;
tableColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Map, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Map, String> mapStringCellDataFeatures) {
return new SimpleStringProperty(finalI+"");
}
});
tableView.getColumns().add(tableColumn);
}
for (int i = 0; i < 10; i++) {
Map<String,String> map = new HashMap<>();
tableView.getItems().add(map);
for (int j = 0; j < size; j++) {
map.put(j+"",j+"");
}
}
root.getChildren().add(tableView);
//Adjust the height according to your screen resolution to reproduce the bug.
Scene scene = new Scene(root, 250, 290);
primaryStage.setScene(scene);
primaryStage.setTitle("Popup at Screen Corner");
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
win10
jdk17
javafx 21
A DESCRIPTION OF THE PROBLEM :
I encountered a strange bug while using the TableView component in JavaFX. To reproduce this bug, the following conditions need to be met:
1. The horizontal scrollbar of the TableView needs to appear.
2. The vertical scrollbar of the TableView needs to appear, but this scrollbar should be non-scrollable.
3. When you scroll down using the mouse wheel and then click on the table, some data inside the table disappears.
However, I monitored the `itemsProperty()` of the TableView and did not find any changes in the elements.
Environment:
- JDK 17
- JavaFX 21
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. The horizontal scrollbar of the TableView needs to appear.
2. The vertical scrollbar of the TableView needs to appear, but this scrollbar should be non-scrollable.
3. When you scroll down using the mouse wheel and then click on the table, some data inside the table disappears.
---------- BEGIN SOURCE ----------
package org.example;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.util.Callback;
import java.util.HashMap;
import java.util.Map;
public class TestTableView extends Application {
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
TableView<Map> tableView = new TableView<>();
int size = 10;
for (int i = 0; i < size; i++) {
TableColumn<Map,String> tableColumn = new TableColumn<>(i+"");
int finalI = i;
tableColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Map, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Map, String> mapStringCellDataFeatures) {
return new SimpleStringProperty(finalI+"");
}
});
tableView.getColumns().add(tableColumn);
}
for (int i = 0; i < 10; i++) {
Map<String,String> map = new HashMap<>();
tableView.getItems().add(map);
for (int j = 0; j < size; j++) {
map.put(j+"",j+"");
}
}
root.getChildren().add(tableView);
//Adjust the height according to your screen resolution to reproduce the bug.
Scene scene = new Scene(root, 250, 290);
primaryStage.setScene(scene);
primaryStage.setTitle("Popup at Screen Corner");
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------