Comment pouvez-vous envoyer des informations à la barre des tâches Windows à partir de java o javafx

Comme lorsque vous téléchargez quelque chose depuis Chrome, l’icône de la barre des tâches s’affiche comme suit:

barre des tâches Windows

Je voudrais montrer la progression de mon programme dans la barre des tâches comme ça. comment pouvez-vous faire cela en utilisant javaFX …?

espère que cette façon aide

 package so; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import javax.imageio.ImageIO; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Scene; import javafx.scene.SnapshotParameters; import javafx.scene.control.Button; import javafx.scene.control.ProgressBar; import javafx.scene.image.Image; import javafx.scene.image.WritableImage; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class JavaFXExample extends Application { public static void main(Ssortingng[] args) { launch(args); } private static final int ICONSIZE = 16; ProgressBar bar = new ProgressBar(0.2d); @Override public void start(Stage primaryStage) { primaryStage.setTitle("change taskbar icon"); Button btn = new Button(); btn.setText("click me several times while looking at task bar"); bar.setMaxWidth(ICONSIZE); btn.setOnAction(ev -> { bar.setProgress(bar.getProgress() + 0.1d); WritableImage image = new WritableImage(ICONSIZE, ICONSIZE); bar.snapshot(new SnapshotParameters(), image); File file; try { file = File.createTempFile("temp-image", ".png"); } catch (IOException e1) { e1.printStackTrace(); return; } try { ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", file); } catch (IOException e) { e.printStackTrace(); } InputStream is; try { is = new FileInputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); return; } primaryStage.getIcons().clear(); primaryStage.getIcons().add(new Image(is)); try { is.close(); } catch (IOException e) { e.printStackTrace(); } }); VBox box = new VBox(bar, btn); primaryStage.setScene(new Scene(box, 300, 250)); primaryStage.show(); } }