Please, change the edfault value from LEFT, as it was to CENTER as it appears to be now.
import com.sun.javafx.runtime.VersionInfo;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.css.CssMetaData;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
setUserAgentStylesheet(STYLESHEET_MODENA);
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(createScene());
Platform.runLater(new Runnable() {
@Override
public void run() {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
Button b = new Button();
Map<String, CssMetaData> styles = new HashMap<>();
for (CssMetaData data : b.getCssMetaData()) {
styles.put(data.getProperty(), data);
}
CssMetaData data = styles.get(getTestedStyle());
System.out.println("Initial value " + data.getInitialValue(b));
}
});
stage.show();
}
private Scene createScene() {
return new Scene(new AnchorPane());
}
private String getTestedStyle() {
return "-fx-text-alignment";
}
}
import com.sun.javafx.runtime.VersionInfo;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.css.CssMetaData;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
setUserAgentStylesheet(STYLESHEET_MODENA);
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(createScene());
Platform.runLater(new Runnable() {
@Override
public void run() {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
Button b = new Button();
Map<String, CssMetaData> styles = new HashMap<>();
for (CssMetaData data : b.getCssMetaData()) {
styles.put(data.getProperty(), data);
}
CssMetaData data = styles.get(getTestedStyle());
System.out.println("Initial value " + data.getInitialValue(b));
}
});
stage.show();
}
private Scene createScene() {
return new Scene(new AnchorPane());
}
private String getTestedStyle() {
return "-fx-text-alignment";
}
}
- blocks
-
JDK-8117289 CSS: update cssref for 8.0
- Resolved