Reputation: 1547
I'm trying to apply some CSS on JavaFx8 TreeTableView and when I run the application I get
Feb 04, 2015 9:13:24 AM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
WARNING: Resource "font-size: 10px;" not found.
and here is the code I'm using:
private TreeItem<ZajelUser> root;
root = ...
TreeTableView<ZajelUser> treeTableView;
treeTableView = new TreeTableView<>(root);
treeTableView.getStylesheets().add("font-size: 10px;");
treeTableView.applyCss();
Upvotes: 0
Views: 578
Reputation: 11134
So there are two mistakes here:
Node.setStyle
. Otherwise create a CSS file, write the rules there and attach the stylesheet with treeTableView.getStylesheets().add("myStyles.css;");
font-size: 10px;
to -fx-font-size: 10px;
.See the JavaFX CSS Reference Guide.
Upvotes: 2