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

REGRESSION: showXXXDialog() of JOptionPane hangs the application

XMLWordPrintable

    • mantis
    • x86
    • windows_nt



      Name: gm110360 Date: 05/24/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION : Windows NT Version 4.0,
      Service pack 6.0


      ADDITIONAL OPERATING SYSTEMS : SunOS 5.7



      A DESCRIPTION OF THE PROBLEM :
      When you try to display any dialog box provided by
      JOptionPane from any of the methods (windowClosing,
      windowActivated or windowDeactivated) of WindowAdapter
      class, the entire application will hang even before the
      dialog box is painted.

      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.use any of the showXXXDialog() methods of JOptionPane in
      any WindowAdapter method.(I tried showInputDialog &
      showConfirmDialog from windowClosing, windowActivated &
      windowDeactivated)
      2.compile the application & run it.
      3.try doing the action which is supposed to display the
      dialog & the application will hang.(Ex, try closing the
      application if showXXXDialog() method is in windowClosing of
      WindowAdapter)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The result should be proper display & working of the dialog
      box, instead the application hangs even before the dialog
      box is painted.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      I tried to put the showXXXDialog inside a try/catch block but no exception was
      caught & no error message was displayed.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class JOptionPaneBug extends JFrame{


          public JOptionPaneBug(){

      setTitle("JOptionPaneBug Test Program");

      setSize(300,300);

      JPanel panel = new JPanel();

      JLabel label = new JLabel("Application to show the bug !");

      panel.add(label);

      getContentPane().add(panel,BorderLayout.SOUTH);

      //Anonymous inner class to terminate the program

      this.addWindowListener(new WindowAdapter()
      {
      public void windowClosing(WindowEvent evt)
      {
      JOptionPane.showInputDialog(new
      String[] {
      "Please enter 0 to exit."});
      System.exit(0);
      }

      public void windowActivated(WindowEvent e) {

      }
      public void windowDeactivated(WindowEvent e)
      {
      JOptionPane.showConfirmDialog(null, new
      String[] {
      "The window was deactivated.",
      "Do you want the application window to lose focus?"});
      }

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

      JOptionPaneBug test = new JOptionPaneBug();
      test.setVisible(true);

          }
          
      }


      ---------- END SOURCE ----------

      Release Regression From : 1.3.1_03
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 145615)
      ======================================================================

            son Oleg Sukhodolsky (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: