-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
P3
-
Affects Version/s: fx2.0
-
Component/s: javafx
-
Environment:
java.vendor=Sun Microsystems Inc.
java.version=1.6.0_24
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=19.1-b02
os.name=Windows 7
os.arch=x86
os.version=6.1JavaFX 2.0ea b18
I've this style sheet:
.scene {
/* My own color names */
textcolor: darkgreen;
}
.label {
-fx-text-fill: textcolor;
}
.styled-button {
-fx-text-fill: white !important;
-fx-font-size: 23;
}
but my button color is green, not white.
Source code:
package org.sepix.javafx.csstheming;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class SmallCSS extends Stage {
String style = "/org/sepix/javafx/csstheming/styles/small.css";
/*
.scene {
textcolor: darkgreen;
}
.label {
-fx-text-fill: textcolor;
}
.styled-button {
-fx-text-fill: white !important;
-fx-font-size: 23;
}
*/
public SmallCSS() {
VBox vbox = new VBox();
Scene scene = new Scene (vbox);
scene.getStylesheets().add (style);
Label label = new Label("A Label");
Button button = new Button("Button");
button.getStyleClass().add("styled-button");
vbox.getChildren().addAll(label, button);
setScene(scene);
}
}
.scene {
/* My own color names */
textcolor: darkgreen;
}
.label {
-fx-text-fill: textcolor;
}
.styled-button {
-fx-text-fill: white !important;
-fx-font-size: 23;
}
but my button color is green, not white.
Source code:
package org.sepix.javafx.csstheming;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class SmallCSS extends Stage {
String style = "/org/sepix/javafx/csstheming/styles/small.css";
/*
.scene {
textcolor: darkgreen;
}
.label {
-fx-text-fill: textcolor;
}
.styled-button {
-fx-text-fill: white !important;
-fx-font-size: 23;
}
*/
public SmallCSS() {
VBox vbox = new VBox();
Scene scene = new Scene (vbox);
scene.getStylesheets().add (style);
Label label = new Label("A Label");
Button button = new Button("Button");
button.getStyleClass().add("styled-button");
vbox.getChildren().addAll(label, button);
setScene(scene);
}
}
- duplicates
-
JDK-8113693 !important present in Author CSS doesn't supercede style property
-
- Closed
-