/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package testtextfill; import com.sun.javafx.css.Style; import com.sun.javafx.css.StyleableProperty; import java.util.List; import java.util.Map.Entry; import javafx.application.Application; import javafx.beans.value.WritableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableMap; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.stage.Stage; /** * Test case for Fx 2.2 */ public class TestTextFill extends Application { @Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello World!"); final Button btn = new Button(); final ObservableMap> map = FXCollections.observableHashMap(); btn.setText("Say 'Hello World'"); btn.setTextFill(Color.PINK); // btn.getStyleClass().add("textfill-yellow"); btn.setStyle("-fx-text-fill: green;"); btn.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { btn.impl_setStyleMap(map); btn.impl_processCSS(true); for(WritableValue w : map.keySet()){ List