Swing中任务栏的JavaFX等效项[duplicate]

问题描述 投票:0回答:1
我正在寻找与Swing Taskbar(aka TaskBarList3)类似的JavaFX

我在javafx文档中进行了搜索,但找不到。

    该功能尚不可用吗?
  • 还有其他方法达到相同的结果?
  • 我需要使用JavaFX在任务栏中设置图标进度,例如this
  • java windows swing javafx-8
    1个回答
    0
    投票
    尚无官方工具包,但是有一个名为FXTaskbarProgressbar的开源库,因此您可以在javafx的任务栏上显示进度。

    此用法的快速示例:

    import com.nativejavafx.TaskbarProgressbar; //import the neccessary class public class TaskbarProgressbarExample extends Application{ @Override public void start(Stage primaryStage){ //create an object of it, and pass the stage object to it's constructor TaskbarProgressbar taskbarProgressbar = new TaskbarProgressbar(primaryStage); primaryStage.setScene(new Scene(new StackPane(new Button("example")))); primaryStage.show(); //show the stage before display the progress on the taskbar //display a custom progress on the taskbar taskProgressbar.showOtherProgress(/*The actual process value*/50, /*the max value of the process*/100, TaskbarProgressbar.TaskbarProgressbarType.NORMAL); } public static void main(String... args){ Application.launch(args); } }

    有关更多示例和信息,请转到repository
    © www.soinside.com 2019 - 2024. All rights reserved.