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

Toolkit.getImage(String path) throws NullPointerException

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0fcs
    • CPU:
      sparc
    • OS:
      solaris_2.4
    • Verification:
      Verified

      Description

      > 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)

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: