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

Title in JOptionPane.showXXXDialog() stuck at first setting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.5
    • client-libs



      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)
      ======================================================================

            smanisunw Sunita Mani (Inactive)
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: