-
Bug
-
Resolution: Fixed
-
P3
-
8u20, 9
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8267644 | 8u321 | Kumar Abhishek | P3 | Resolved | Fixed | b01 |
JDK-8255609 | jfx11.0.10 | Jose Pereda | P3 | Resolved | Fixed |
FULL PRODUCT VERSION :
'Version '1.8.0_121' Home '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre'
ADDITIONAL OS VERSION INFORMATION :
macOS Sierra
Version 10.12.3
A DESCRIPTION OF THE PROBLEM :
When inserting items into a TableView the following issues are observed:
1. With TableView.getSelectionModel().setCellSelectionEnabled(true), the selection flashes on each insert.
2. If you scroll the table slightly and then stop scrolling, the table view does not stop scrolling. You can see the table view scroll slowly upwards as new items are inserted.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached test case which inserts items into the TableView on a timer.
Scroll down slightly and select a cell.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The cell shouldn't flash and the table should not scroll slowly upwards.
ACTUAL -
The selected cell flashes and the table view scrolls slowly upwards.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.util.Duration;
public class TableViewSample extends Application {
private final TableView<String> table = new TableView<>();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) {
Scene scene = new Scene(new Group());
stage.setTitle("Table View Sample");
stage.setWidth(300);
stage.setHeight(500);
final Label label = new Label("Address Book");
label.setFont(new Font("Arial", 20));
table.setEditable(true);
table.getSelectionModel().setCellSelectionEnabled(true);
table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
TableColumn<String, String> column = new TableColumn<>("First Name");
column.setCellValueFactory(value -> new SimpleStringProperty(value.getValue()));
table.getColumns().add(column);
final VBox vbox = new VBox();
vbox.setSpacing(5);
vbox.setPadding(new Insets(10, 0, 0, 10));
vbox.getChildren().addAll(label, table);
((Group) scene.getRoot()).getChildren().addAll(vbox);
stage.setScene(scene);
stage.show();
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(100),ae -> timerFired()));
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();
}
private void timerFired()
{
table.getItems().add("Flashes & Scrolling");
}
}
---------- END SOURCE ----------
'Version '1.8.0_121' Home '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre'
ADDITIONAL OS VERSION INFORMATION :
macOS Sierra
Version 10.12.3
A DESCRIPTION OF THE PROBLEM :
When inserting items into a TableView the following issues are observed:
1. With TableView.getSelectionModel().setCellSelectionEnabled(true), the selection flashes on each insert.
2. If you scroll the table slightly and then stop scrolling, the table view does not stop scrolling. You can see the table view scroll slowly upwards as new items are inserted.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached test case which inserts items into the TableView on a timer.
Scroll down slightly and select a cell.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The cell shouldn't flash and the table should not scroll slowly upwards.
ACTUAL -
The selected cell flashes and the table view scrolls slowly upwards.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.util.Duration;
public class TableViewSample extends Application {
private final TableView<String> table = new TableView<>();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) {
Scene scene = new Scene(new Group());
stage.setTitle("Table View Sample");
stage.setWidth(300);
stage.setHeight(500);
final Label label = new Label("Address Book");
label.setFont(new Font("Arial", 20));
table.setEditable(true);
table.getSelectionModel().setCellSelectionEnabled(true);
table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
TableColumn<String, String> column = new TableColumn<>("First Name");
column.setCellValueFactory(value -> new SimpleStringProperty(value.getValue()));
table.getColumns().add(column);
final VBox vbox = new VBox();
vbox.setSpacing(5);
vbox.setPadding(new Insets(10, 0, 0, 10));
vbox.getChildren().addAll(label, table);
((Group) scene.getRoot()).getChildren().addAll(vbox);
stage.setScene(scene);
stage.show();
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(100),ae -> timerFired()));
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();
}
private void timerFired()
{
table.getItems().add("Flashes & Scrolling");
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8255609 TableView scrolls slightly when adding new elements
- Resolved
-
JDK-8267644 TableView scrolls slightly when adding new elements
- Resolved
- duplicates
-
JDK-8194328 TableView scrolls slightly when adding items
- Closed
- relates to
-
JDK-8177945 Single cell selection flickers when adding data to TableView
- Resolved
(1 links to)