/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package tooltip; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.scene.control.Tooltip; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class TooltipOnTextField extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { Button button1 = new Button("Button"); button1.setTooltip(new Tooltip("Tooltip Button ")); TextField tf = new TextField("Something"); tf.setTooltip(new Tooltip("This is a textfield")); HBox box = new HBox(30); box.getChildren().addAll(button1, tf); Scene scene = new Scene(box, 400, 300); scene.setFill(Color.CHOCOLATE); stage.setScene(scene); stage.setTitle("Tooltip Test"); stage.show(); } }