/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import fxmlteste.*; import java.text.DateFormat; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.logging.Level; import java.util.logging.Logger; import javafx.application.Application; import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.NumberField; import javafx.scene.control.TextField; import javafx.scene.control.Tooltip; import javafx.scene.layout.VBox; import javafx.stage.Stage; /** * * @author Giovanni */ public class BackTeste extends Application { public static void main(String[] args) { Application.launch(TextText.class, args); } @Override public void start(Stage primaryStage) throws Exception { final TextField t = new TextField("teste"); t.setStyle( "-fx-background-image: url(\"warning.png\");" +"-fx-background-position: center;" +"-fx-background-repeat: no-repeat;" +"-fx-background-size: auto;" ); VBox root = new VBox(); root.getChildren().addAll(t); primaryStage.setScene(new Scene(root, 300, 100)); primaryStage.show(); } }