4 Replies Latest reply on Nov 20, 2012 11:45 PM by 974872

    ImageIcon(getClass().getResource exception

      I have a java project that runs fine in NetBeans, but fails in JDeveloper. The exception occurs at the middle line:
      for (int i = 0; i < NUMBER_OF_LIGHTNINGS ; i++) {
      pictures[i] = new ImageIcon(getClass().getResource("/" + folder + "/lightning" + i + ".jpg"));

      where local variable folder = "image" which is a folder name under the project folder. Folder image contains image files with names:
      lightning0.jpg, lightning1.jpg and so on.
      I get null exception.

      I have JDeveloper 11g Release 2 running Windows 7.

      Does anybody know why I get the exception? I did try to set the full path for the image file, but still got exception.

      Thanks in advance for the help.