-
Bug
-
Resolution: Fixed
-
P2
-
9, 10
FULL PRODUCT VERSION :
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
macOS Sierra, 10.12.6
A DESCRIPTION OF THE PROBLEM :
The layout of table and tree table view column headers becomes messed up when specifying a preferred height for the column headers inside a stylesheet.
REGRESSION. Last worked in version 8u144
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run this application. Make sure the stylesheet.css file is in the same location.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The five column headers created by the test application should be simply taller than their default height. They should be as tall as the value specified via -fx-pref-height inside the stylesheet.
ACTUAL -
The column headers do have the specified new height but in addition one can see a blank column header above spanning all five columns. It almost looks like a parent column header.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.stage.Stage;
public class TableViewBug extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
TableView<String> tableView = new TableView<>();
for (int i = 0; i < 5; i++) {
TableColumn<String, String> column = new TableColumn<>("Col " + i);
tableView.getColumns().add(column);
}
Scene scene = new Scene(tableView);
scene.getStylesheets().add(TableViewBug.class.getResource("style.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setWidth(500);
primaryStage.setHeight(400);
primaryStage.centerOnScreen();
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
--------------------------- Stylesheet ---------------------------
.column-header {
-fx-pref-height: 100px;
}
---------- END SOURCE ----------
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
macOS Sierra, 10.12.6
A DESCRIPTION OF THE PROBLEM :
The layout of table and tree table view column headers becomes messed up when specifying a preferred height for the column headers inside a stylesheet.
REGRESSION. Last worked in version 8u144
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run this application. Make sure the stylesheet.css file is in the same location.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The five column headers created by the test application should be simply taller than their default height. They should be as tall as the value specified via -fx-pref-height inside the stylesheet.
ACTUAL -
The column headers do have the specified new height but in addition one can see a blank column header above spanning all five columns. It almost looks like a parent column header.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.stage.Stage;
public class TableViewBug extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
TableView<String> tableView = new TableView<>();
for (int i = 0; i < 5; i++) {
TableColumn<String, String> column = new TableColumn<>("Col " + i);
tableView.getColumns().add(column);
}
Scene scene = new Scene(tableView);
scene.getStylesheets().add(TableViewBug.class.getResource("style.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setWidth(500);
primaryStage.setHeight(400);
primaryStage.centerOnScreen();
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
--------------------------- Stylesheet ---------------------------
.column-header {
-fx-pref-height: 100px;
}
---------- END SOURCE ----------
- relates to
-
JDK-8166013 NestedTableColumnHeader: must use factory method for header creation always
-
- Resolved
-
-
JDK-8166021 NestedTableColumnHeader: package private access to skin prevents custom headers
-
- Resolved
-
-
JDK-8166025 TableColumnHeader: loses custom style classes
-
- Resolved
-