JDK-4128486 : Title in JOptionPane.showXXXDialog() stuck at first setting
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-04-13
  • Updated: 1998-04-16
  • Resolved: 1998-04-16
Related Reports
Duplicate :  
Description

Name: rk38400			Date: 04/13/98


On Windows NT 4.0, using JDK 1.1.5 and JFC 1.1 (Swing 1.0.1):

Each of the JOptionPane.showMessageDialog's with different Titles are displayed with the first title "First Title!".  Other tests show this problem exists in general for me using showXXXDialog().

import com.sun.java.swing.*;
import java.awt.event.*;

public class bug
{
 JFrame frame = null;
 JDesktopPane desktop = null;

 public static void main( String args[] )
 {
  new bug();
 }

 public bug()
 {
  frame = new JFrame( "Frame Title" );
  desktop = new JDesktopPane();
  frame.getContentPane().add( desktop );
  frame.addWindowListener( new WindowAdapter()
   {
    public void windowClosing( WindowEvent e )
    {
     System.exit( 0 );
    }
   } );

  JMenuBar menuBar = new JMenuBar();
  JMenu menu = new JMenu( "Menu" );
  menuBar.add( menu );
  JMenuItem doit = new JMenuItem( "Doit" );
  menu.add( doit );

  doit.addActionListener( new ActionListener()
   {
    public void actionPerformed( ActionEvent e )
    {
     JOptionPane.showMessageDialog( frame,
      "This is the First Message",
       "First Title",
        JOptionPane.INFORMATION_MESSAGE );

     JOptionPane.showMessageDialog( frame,
      "This is the Second Message",
       "Second Title",
        JOptionPane.INFORMATION_MESSAGE );

     JOptionPane.showMessageDialog( frame,
      "This is the Third Message",
       "Third Title",
        JOptionPane.INFORMATION_MESSAGE );

     JOptionPane.showMessageDialog( frame,
      "This is the Forth and Final Message\n" +
       "My Titles have been all set to " +
        "'First Title'",
         "Forth Title",
          JOptionPane.INFORMATION_MESSAGE );
    }
   } );

  frame.setJMenuBar( menuBar );
  frame.setBounds( 200, 200, 640, 480 );
  frame.setVisible( true );
 }
}
(Review ID: 26585)
======================================================================

Comments
WORK AROUND Name: rk38400 Date: 04/13/98 If I use JOptionPane.showInternalXXXDialog's the title changes as expected, but Modal functionality does not! ======================================================================
11-06-2004