ImageIcons do not work with BufferedImages on Windows-NT

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 1.2.0
    • Component/s: client-libs



      Name: rk38400 Date: 04/17/98


      I have already submitted this bug once, but have not
      seen it appear in the bug list. This causes serious problems
      for our application. This worked prior to release 3.

      If I create an ImageIcon from a BufferedImage as
      in:

      ImageIcon buildIcon(BufferedImage bi) {
        return new ImageIcon(bi);
      }

      this works on Solaris but fails on Windows NT.
      The exception I get is:

      java.lang.ClassCastException: java.awt.image.BufferedImage
              at sun.awt.windows.WToolkit.checkScrImage(WToolkit.java:284)
              at sun.awt.windows.WToolkit.checkImage(WToolkit.java:296)
              at java.awt.Component.checkImage(Component.java:1857)
              at java.awt.ImageMediaEntry.getStatus(MediaTracker.java:883)
              at java.awt.MediaTracker.statusID(MediaTracker.java:680)
              at java.awt.MediaTracker.waitForID(MediaTracker.java:627)
              at java.awt.swing.ImageIcon.loadImage(ImageIcon.java:184)
              at java.awt.swing.ImageIcon.<init>(ImageIcon.java:124)
              at Test.main(Test.java:11)
      (Review ID: 28588)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: