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

[macosx] Cannot set JDesktopManager on Mac OSX

XMLWordPrintable

      FULL PRODUCT VERSION :
      1.7.0_07

      ADDITIONAL OS VERSION INFORMATION :
      Mac OSX Lion

      A DESCRIPTION OF THE PROBLEM :
      UIManager.getSystemLookAndFeelClassName();
      jDesktopPane1.setDesktopManager(new DefaultDesktopManager() );

      Above runs, but when a JInternalFrame is minimized, RepaintManager reports a null pointer exception in line 965.

      This works on Windows, and on Apple Java 6.



      REGRESSION. Last worked in version 6u31

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      working JWS example of source code below:

      http://www.whatifsquared.com/desktopmgrexample.jnlp


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package desktopMgrExample;
      import java.awt.*;
      import javax.swing.*;

      public final class DesktopMgrExample extends JFrame {
       
          public DesktopMgrExample() {
              try{ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception ex){}
              initComponents();
              
              jDesktopPane1.setDesktopManager(new DefaultDesktopManager() );
              
              final JInternalFrame myIFrame = new JInternalFrame( " Title " , true, true, true, true);
              myIFrame.setSize(300, 300);
              myIFrame.setLocation(20,20);

              jDesktopPane1.add(myIFrame, JLayeredPane.PALETTE_LAYER);
              myIFrame.setVisible(true);
          
          }
          // <editor-fold defaultstate= " collapsed " desc= " Generated Code " >
          private void initComponents() {

              jDesktopPane1 = new javax.swing.JDesktopPane();

              setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
              setPreferredSize(new java.awt.Dimension(500, 500));
              getContentPane().add(jDesktopPane1, java.awt.BorderLayout.CENTER);

              pack();
          }// </editor-fold>
          //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          public static void main(final String args[]) throws AWTException {
              
              java.awt.EventQueue.invokeLater(new Runnable() {
                  
                  @Override
                  public void run() {
                      new DesktopMgrExample().setVisible(true);
                  }
              });
          }
          // Variables declaration - do not modify
          private javax.swing.JDesktopPane jDesktopPane1;
          // End of variables declaration

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Detect Java 7 on OSX, still with default manager

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: