I need some functionality that I cannot find currently in JavaFX. Like the Robot or the Tray Icon.
I know these tools do work with JavaFx applications. But is it ok to use them? Are there any considerations that I should care of?
Java awt is the first generation, Java Swing is the second generation and the JavaFx is the third generation UI-Toolkit for designing and implementing Graphical User Interfaces with Java.
Swing is the standard toolkit for Java developer in creating GUI, whereas JavaFX provides platform support for creating desktop applications. Swing has a more sophisticated set of GUI components, whereas JavaFX has a decent number of UI components available but lesser than what Swing provides.
JavaFX new fixes will continue to be supported on Java SE 8 through March 2022 and removed from Java SE 11. Swing and AWT will continue to be supported on Java SE 8 through at least March 2025, and on Java SE 11 (18.9 LTS) through at least September 2026.
A JavaFX Scene can be integrated into Swing code via the JavaFX class JFXPanel and its setScene(Scene) method.
Generally it's not advised.
N.B.:
JFXPanel
is aware how to handle that conflicts.you can use Glass robot instead of AWT one (although it's not public API and may be changed in future):
Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot();
robot.mouseMove(10, 30);
robot.mousePress(1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With