dustinkredmond / FXTrayIcon

Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.
MIT License
324 stars 25 forks source link

How to set Taskbar icon to JFXFileChooser? #66

Closed ctoabidmaqbool closed 1 year ago

ctoabidmaqbool commented 1 year ago

As Javafx File Chooser have no icon (but in swing icon can be set). So how can icon be changed or hide from taskbar?

Javafx File Chooser show icon of java at taskbar which is boaring...

dustinkredmond commented 1 year ago

For JavaFX's FileChooser, it will inherit the application dialog of the parent stage. You must have a visible parent stage for this to work, then call the FileChooser as below:

stage.getIcons().add(new Image("<path-to-image>"));
FileChooser fileChooser = new FileChooser();
File result = fileChooser.showSaveDialog(stage);

Closing this issue as this is JavaFX behavior rather than anything done by the FXTrayIcon library.