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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -