java - JavaFX css class style -
how can set css style class extends javafx object?
public class diagrampane extends scrollpane implements idiagrameditor { // .... methods go here }
i've tried following ways in main method:
public class diagrampane extends scrollpane implements idiagrameditor { diagrampane() { this.setstyle("-fx-background-color: #f8ecc2;-fx-font-size: 8pt;"); setstyle("-fx-background-color: #f8ecc2;-fx-font-size: 8pt;"); } }
add these lines css file
.diagram-pane { -fx-background-color: #f8ecc2; -fx-font-size: 8pt; }
and set diagrampane
instance use diagram-pane
style class
diagrampane.getstyleclass().clear(); diagrampane.getstyleclass().add("diagram-pane");
Comments
Post a Comment