/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package comboboxdragtestcase; import java.util.logging.Logger; import javafx.application.Application; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.scene.control.Tooltip; import javafx.scene.input.MouseEvent; import javafx.scene.layout.StackPane; import javafx.stage.Stage; /** * * @author Kiril */ public class ComboBoxDragTestCase extends Application { private final static Logger logger = Logger.getLogger(ComboBoxDragTestCase.class.getName()); /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Invalid Drag Event!"); ComboBox comboBox = new ComboBox(); comboBox.getItems().add("One again"); comboBox.getItems().add("Two again"); comboBox.getItems().add("Three again"); comboBox.setTooltip(new Tooltip("My Tooltip")); StackPane root = new StackPane(); root.getChildren().add(comboBox); Scene scene = new Scene(root, 300, 250); scene.setOnMouseDragged(new EventHandler() { public void handle(MouseEvent e) { logger.info("Drag detected: "+e); } }); scene.setOnMousePressed(new EventHandler() { public void handle(MouseEvent e) { logger.info("Mouse Pressed: "+e); } }); primaryStage.setScene(scene); primaryStage.show(); } }