How do I change the default application icon in Java?

后端 未结 10 812
心在旅途
心在旅途 2020-11-27 17:02

I\'m using NetBeans, trying to change the familiar Java coffee cup icon to a png file that I have saved in a resources directory in the jar file. I\'ve found many different

10条回答
  •  情深已故
    2020-11-27 17:21

    Or place the image in a location relative to a class and you don't need all that package/path info in the string itself.

    com.xyz.SomeClassInThisPackage.class.getResource( "resources/camera.png" );
    

    That way if you move the class to a different package, you dont have to find all the strings, you just move the class and its resources directory.

提交回复
热议问题