-
Bug
-
Resolution: Fixed
-
P4
-
8u60
-
b04
-
x86_64
-
linux_ubuntu
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8315792 | jfx17.0.9 | Jose Pereda | P4 | Resolved | Fixed | b03 |
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
A DESCRIPTION OF THE PROBLEM :
if selectIndices is called with only the argument zero, it does nothing.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See source code.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package sample;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyStringWrapper;
import javafx.collections.FXCollections;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.stage.Stage;
public class Main extends Application {
static final int INDEX_TO_SELECT = 0;
@Override
public void start(Stage primaryStage) {
final TableView root = new TableView();
final TableColumn<?, String> col = new TableColumn("col");
root.getColumns().add(col);
root.setItems(FXCollections.observableArrayList(1,2,3));
col.setCellValueFactory(data -> new ReadOnlyStringWrapper("1"));
root.getSelectionModel().selectIndices(INDEX_TO_SELECT, new int[0]);
assert root.getSelectionModel().isSelected(INDEX_TO_SELECT);
System.exit(0);
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
A DESCRIPTION OF THE PROBLEM :
if selectIndices is called with only the argument zero, it does nothing.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See source code.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package sample;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyStringWrapper;
import javafx.collections.FXCollections;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.stage.Stage;
public class Main extends Application {
static final int INDEX_TO_SELECT = 0;
@Override
public void start(Stage primaryStage) {
final TableView root = new TableView();
final TableColumn<?, String> col = new TableColumn("col");
root.getColumns().add(col);
root.setItems(FXCollections.observableArrayList(1,2,3));
col.setCellValueFactory(data -> new ReadOnlyStringWrapper("1"));
root.getSelectionModel().selectIndices(INDEX_TO_SELECT, new int[0]);
assert root.getSelectionModel().isSelected(INDEX_TO_SELECT);
System.exit(0);
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8315792 TableViewSelectionModel.selectIndices does not select index 0
- Resolved