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

showInternalMessageBox fills entire JDesktopPane (Win L&F only; Metal fine)

XMLWordPrintable

    • beta
    • x86
    • windows_nt



      Name: skT88420 Date: 01/19/2000


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      When executing JOptionPane.showInternalMessageDialog(...) on a JDesktopPane
      which already contains a maximized JInternalFrame the resulting message window
      is also maximized to fill the entire JDesktopPane.

      This occurs on Windows (95 and NT, not tested on 98) when using the Windows
      System Look and Feel, not when using the default look and feel. The same
      problem occurs when calling showInternalConfirmDialog(...).

      The following program illustrates this. Choose the 'File.Exit' command with
      and without the internal frame maxmized. Also try it when commenting out the
      call to setLookAndFeel(...). This application was tested under JDK 1.2.2 using
      Symantec Visual Cafe v3.0c.

      import java.awt.*;
      import java.awt.event.* ;
      import javax.swing.*;

      class Test extends JFrame implements ActionListener
      {
          private JDesktopPane desktop ;
          
          public Test ()
          {
              getContentPane().add( desktop = new JDesktopPane () ) ;
              
              JMenuBar mb = new JMenuBar() ;
              JMenu menu = new JMenu( "File" );
              mb.add( menu ) ;
              JMenuItem menuItem = menu.add( new JMenuItem( "Exit" ) );
              menuItem.addActionListener( this ) ;
              setJMenuBar( mb ) ;
              Dimension sDim = Toolkit.getDefaultToolkit().getScreenSize();
              setSize ( sDim.width/2, sDim.height/2 ) ;
              setVisible( true );
              JInternalFrame frame=new JInternalFrame("Internal",true,true,true,true);
              frame.setSize( desktop.getSize().width, desktop.getSize().height/2 ) ;
              desktop.add ( frame, JLayeredPane.FRAME_CONTENT_LAYER );
          }

          public void actionPerformed ( ActionEvent aEvent )
          {
              JOptionPane.showInternalMessageDialog( desktop, "Exiting test app" ); // same result if "frame" used as parent
              System.exit(0);
          }
          
          public static void main ( String args [] )
          {
              try
              {
                  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              }
              catch ( Exception x ) {}
              new Test();
          }
      }

      Obviously not a major problem, but I am getting some snide comments from my
      VB colleagues.
      (Review ID: 100141)
      ======================================================================

            hgajewsksunw Hania Gajewska (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: