设置可执行Jar文件的图标 [英] Set Icon for executable Jar file

查看:285
本文介绍了设置可执行Jar文件的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的可执行Jar文件。我该如何为这个文件设置图标?在我的情况下,我使用标准的Jar图标,我想更改。

I have a simple executable Jar file. How I can set icon for this file? In my case I use the standard Jar icon which I would like to change.

推荐答案

您可以使用 setIconImage

frame.setIconImage(
new ImageIcon(getClass().getClassLoader().getResource("PATH/TO/YourImage.png"))
);






更新



如果您想更改咖啡杯,那么您可以使用 JSmooth 创建可执行的java文件并更改jar文件图标。


Update

If you want to change the coffee-cup then you may use tools like JSmooth to create executable java file and also change the jar file icon.

正如您在评论中看到的那样 JSmooth 可用于Windows操作系统。对于 Mac ,您可以查看链接

As you can see in the comments JSmooth can be used for windows operating systems. For Mac you can check the link here on how to change the icon.

对于 linux 您可以创建操作系统桌面启动器并为其选择一个图标图片。

For linux OS you can create a desktop launcher and choose an icon image for it.

这篇关于设置可执行Jar文件的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆