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

Nimbus: JInternalFrame() causes exception if user UI installed

    Details

      Description

      code


                      LookAndFeel[] auxLafs = UIManager.getAuxiliaryLookAndFeels();
                      LookAndFeel lnf = new AuxiliaryLookAndFeel();
                      try {
                          //removing auxiliary look and feels
                          if (auxLafs != null) {
                              for (int i=0; i<auxLafs.length; i++) {
                                  UIManager.removeAuxiliaryLookAndFeel(auxLafs[i]);
                              }
                          }

                          UIManager.addAuxiliaryLookAndFeel(lnf);
                          new JInternalFrame();


      causes exception if Nimbus LaF specified:

      Exception in thread "main" java.lang.ClassCastException: javax.swing.plaf.multi.MultiPopupMenuUI cannot be cast to javax.swing.plaf.synth.SynthPopupMenuUI
      at javax.swing.plaf.synth.DefaultMenuLayout.invalidateLayout(DefaultMenuLayout.java:35)
      at javax.swing.BoxLayout.addLayoutComponent(BoxLayout.java:262)
      at java.awt.Container.addImpl(Container.java:1074)
      at java.awt.Container.add(Container.java:365)
      at javax.swing.JPopupMenu.add(JPopupMenu.java:264)
      at javax.swing.JPopupMenu.add(JPopupMenu.java:289)
      at javax.swing.plaf.synth.SynthInternalFrameTitlePane.addSystemMenuItems(SynthInternalFrameTitlePane.java:183)
      at javax.swing.plaf.synth.SynthInternalFrameTitlePane.assembleSystemMenu(SynthInternalFrameTitlePane.java:155)
      at javax.swing.plaf.basic.BasicInternalFrameTitlePane.installTitlePane(BasicInternalFrameTitlePane.java:106)
      at javax.swing.plaf.basic.BasicInternalFrameTitlePane.<init>(BasicInternalFrameTitlePane.java:93)
      at javax.swing.plaf.synth.SynthInternalFrameTitlePane.<init>(SynthInternalFrameTitlePane.java:46)
      at javax.swing.plaf.synth.SynthDesktopIconUI.installComponents(SynthDesktopIconUI.java:52)
      at javax.swing.plaf.basic.BasicDesktopIconUI.installUI(BasicDesktopIconUI.java:55)
      at javax.swing.plaf.multi.MultiDesktopIconUI.installUI(MultiDesktopIconUI.java:97)
      at javax.swing.JComponent.setUI(JComponent.java:662)
      at javax.swing.JInternalFrame$JDesktopIcon.setUI(JInternalFrame.java:2165)
      at javax.swing.JInternalFrame$JDesktopIcon.updateUI(JInternalFrame.java:2213)
      at javax.swing.JInternalFrame$JDesktopIcon.<init>(JInternalFrame.java:2145)
      at javax.swing.JInternalFrame.<init>(JInternalFrame.java:331)
      at javax.swing.JInternalFrame.<init>(JInternalFrame.java:250)
      at Test.main(Test.java:25)


      test case is attached to bugster (quite big)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pastepan Pavel Stepanov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: