【问题标题】:How to create icon in windows taskbar in Java (NOT in System tray)?如何在 Java 中的 Windows 任务栏中创建图标(不在系统托盘中)?
【发布时间】:2016-08-10 06:26:42
【问题描述】:

Windows 任务栏而非系统托盘:

请告诉我如何在Java的Windows任务栏中创建一个图标?我只能找到系统托盘的解决方案。如图所示,我想要任务栏上的图标。

【问题讨论】:

    标签: java taskbar


    【解决方案1】:

    当你使用 JFrame 时,你可以像这样设置图标:

    List<Image> icons = new ArrayList<Image>();
    icons.add(new ImageIcon("16.png").getImage());
    icons.add(new ImageIcon("32.png").getImage());
    frame.setIconImages(icons);
    

    此外,当您更改 JFrame 图标时,该图标也会显示在 Windows 任务栏中。

    这是在运行 Java 7 的 Windows 7 中测试的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多