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

Need to throw a better Exception to user when colormap < 256

XMLWordPrintable

    • 2d
    • x86
    • solaris_2.6, solaris_7, windows_98, windows_2000

       When I try to execute an Application with JDK 1.2.x on a system with screen resolution 640x480 and color depth 16 colors, class loader cannot load class
      javax.swing.plaf.metal.MetalLookAndFeel. If the screen resolution is increased
      to 800x600 and color depth to 256 colors everything works fine.

      Test Application:
      import javax.swing.*;

      public class HelloWorld extends JFrame
      {
        public HelloWorld()
        {
          super("Hello World");

      JLabel label = new JLabel("Hello World message");
      getContentPane().add(label);

      pack();
        }
         
        public static void main(String[] args)
        {
          HelloWorld helloWorld = new HelloWorld();
      helloWorld.show();
        }
      }

      Exception Thrown:
      Exception in thread "main" java.lang.Error: can't load
      javax.swing.plaf.metal.MetalLookAndFeel
      at java.lang.Throwable.fillInStackTrace(Native Method)
      at java.lang.Throwable.fillInStackTrace(Compiled Code)
      at java.lang.Throwable.<init>(Compiled Code)
      at java.lang.Error.<init>(Error.java:50)
      at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:826)
      at javax.swing.UIManager.initialize(UIManager.java:896)
      at javax.swing.UIManager.maybeInitialize(UIManager.java:913)
      at javax.swing.UIManager.getUI(UIManager.java:535)
      at javax.swing.JPanel.updateUI(JPanel.java:110)
      at javax.swing.JPanel.<init>(JPanel.java:70)
      at javax.swing.JPanel.<init>(JPanel.java:100)
      at javax.swing.JRootPane.createGlassPane(JRootPane.java:225)
      at javax.swing.JRootPane.<init>(JRootPane.java:181)
      at javax.swing.JFrame.createRootPane(JFrame.java:154)
      at javax.swing.JFrame.frameInit(JFrame.java:147)
      at javax.swing.JFrame.<init>(JFrame.java:124)
      at NotHelloWorldFrame.<init>(NotHelloWorld.java:18)
      at NotHelloWorld.main(NotHelloWorld.java:34)

            prr Philip Race
            collins Gary Collins (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: