خرید بک لینک

Vote count: 0

What I would like to do is change the icon of my program when it runs.

Code I've found is:

      try {
          String imagePath = "res/Image.png";
          InputStream imgStream = this.getClass().getResourceAsStream(imagePath );
          BufferedImage myImg;
          myImg = ImageIO.read(imgStream);
          this.setIconImage(myImg);
      } catch (IOException e) {
          e.printStackTrace();
      }

My question is: where do I put my image and how do I get its path? End result would be to have an .exe (or worst case a .jar) that I would just have to transfer, so I'd like to have the icon inside the exe.

asked 2 mins ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: شنبه 8 اسفند 1394 ساعت: 23:42

صفحه بندی