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

MetalInternalFrameTitlePane() incorrect behavior

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_2.6

      Description

      1) MetalInternalFrameTitlePane() throws NPE if created with a default
      Windows Look and Feel on WinNT under JDK 1.3, 1.3.1

      To reproduce, please run the following test case on Win NT under JDK 1.3 or
      JDK 1.3.1:

      import javax.swing.*;
      import javax.swing.plaf.metal.*;
      import com.sun.java.swing.plaf.windows.*;

      public class test {

          public static void main(String [] args) {
           
          WindowsLookAndFeel wlnf = new WindowsLookAndFeel();

              try {
                  UIManager.setLookAndFeel(wlnf);

              } catch (UnsupportedLookAndFeelException ulnfe) {
                  ulnfe.printStackTrace();
              }
              
              JInternalFrame frame = new JInternalFrame();
              MetalInternalFrameTitlePane c = new MetalInternalFrameTitlePane(frame);
             
          }

      }

      Test output:

      java.lang.NullPointerException
      at javax.swing.plaf.metal.MetalLookAndFeel.getPrimaryControlShadow(MetalLookAndFeel.java:1082)
      at javax.swing.plaf.metal.MetalInternalFrameTitlePane.createButtons(MetalInternalFrameTitlePane.java:91)
      at javax.swing.plaf.basic.BasicInternalFrameTitlePane.installTitlePane(BasicInternalFrameTitlePane.java:99)
      at javax.swing.plaf.basic.BasicInternalFrameTitlePane.<init>(BasicInternalFrameTitlePane.java:77)
      at javax.swing.plaf.metal.MetalInternalFrameTitlePane.<init>(MetalInternalFrameTitlePane.java:56)
      at test.main(test.java:19)
      Exception in thread "main"

      After that test hangs

      2) Same test under jdk1.4 doesn't produce the NullpointerException,
      but also hangs on both windows and solaris.

        Attachments

          Activity

            People

            • Assignee:
              joutwatesunw Joshua Outwater (Inactive)
              Reporter:
              ksoshals Kirill Soshalskiy (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: