A
A
Anton2015-06-03 14:18:44
JavaFX
Anton, 2015-06-03 14:18:44

Is it possible to work with tray (system tray) using JavaFX 8?

I know how to work with Trey using Java AWT in the spirit of

systemTray.add(new TrayIcon(Toolkit.getDefaultToolkit().getImage("src/img/icon.png"), "Tray menu"));
// и так далее

My application is entirely in JavaFX. While I was googling solutions with a tray, I often came across posts from the year before last with thoughts like: "Java 8 will be released soon and there will be cool chips for working with the tray." And almost by means of JavaFX itself.
And now, as the ancestors expected, java 8 came out. I looked through the documentation and did not find anything new on working with the tray, except for the good old systemTray, TrayIcon and others like them.
Questions:
1. Is there an alternative to the AWT tray handling in Java 8?
2. Is it possible to work with the tray using JavaFX 8 without resorting to awt/swing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2015-06-08
@fattan

He asked himself, he answered:
Having shoveled a bunch of English-language waste paper:
1. Is there an alternative to the AWT tray tools in Java 8?
Yes. Through the stump-deck-native methods (referring to OS calls). As I understand it, you need to dig in the direction of SWT and others like them. Yes, so it's easier to use AWT (for my task)
2. Is it possible to work with the tray using JavaFX 8 without resorting to awt/swing?
No. JavaFX 8 does not support tray handling. Perhaps support for working with the tray will be added in the 9th version. In the meantime, suck your thumb, bears.
Bottom line:
The application was left on JavaFX 8, and the work with the tray was moved to a separate class, which was written using AWT SystemTray.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question