Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1231867

Toolkit.getImage(String path) throws NullPointerException

XMLWordPrintable

    • 1.0fcs
    • sparc
    • solaris_2.4
    • Verified

      > I was loading an image using:
      > Toolkit.getDefaultToolkit().createImage(new URLImageSource(path))
      > That method is now gone (at least there isn't one that take a URL) so I
      > switched to the new ToolKit's getImage(String path) instance method.
      > When I try to run this I get:
      >
      > java.lang.NullPointerException
             at sun.awt.win32.MToolkit.getImageFromHash(MToolkit.java:167)
             at sun.awt.win32.MToolkit.getImage(MToolkit.java:180)
             at Eyes.<init>(Eyes.java:59)
             at Animat.<init>(Animat.java:73)
             at Habitat.start(Habitat.java:233)
             at CyberPets.start(CyberPets.java:79)
             at CyberPets.main(CyberPets.java:70)

            tballsunw Tom Ball (Inactive)
            tballsunw Tom Ball (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: