Question: I have images i want to add in the following folder: G:\my java\DesktopApplication1\build\classes\desktopapplication1\resources. 

How to go about adding image in this folder to my labels or frames?

Answer: 
Once built, the image will typically be inside a Jar. The resources in a Jar can be accessed a number of ways, here is one.

```
URL urlToImage = this.getClass().getResource(
    "/desktopapplication1/resources/the.png");
ImageIcon imageIcon = new ImageIcon(urlToImage);
JLabel ...

```
I did something like this:

```
         JLabel l2=new JLabel("");
      try {
        Image img = ImageIO.read(getClass().getResource("resources/wait20.gif"));
        l2.setIcon(new ImageIcon(img));
          }
      catch (IOException ex) {
        }

```

It does work, but i would have liked it more had the GIF animation was displayed. Nevertheless, if a static image is to be displayed, this is the way to do it.