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

JOptionPane.showInternalInputDialog is not as modal as required

XMLWordPrintable

    • x86
    • windows_nt, windows_2000



      Name: rmT116609 Date: 06/17/2004


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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      JOptionPane.showInternalInputDialog is not as modal as required

      When the InternalFrame is shown some things are modal however other things are not. I can't click on the buttons using the mouse, but I can click on the window and then press space bar to activate the button.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run code
      click the bottom button on the right frame
      move the internal frame in the left frame
      click on the right frame
      press the space bar

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      nothing to happen when the space bar is pressed (the frame should be modal against everything, not just mouse clicks on the button)
      ACTUAL -
      another internal frame is shown even though the call to the other one hadn't returned yet

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      public class Test {
        public static void main(String s[]) {
          final JButton leftFrameButton = new JButton(new AbstractAction("Show
      Internal Input Dialog...") {
            public void actionPerformed(ActionEvent anEvent) {
              JOptionPane.showInternalInputDialog((JButton)anEvent.getSource(), "What
      is your name?");
            }
          });

          final JButton windowButton = new JButton(new AbstractAction("Show Internal
      Input Dialog...") {
            public void actionPerformed(ActionEvent anEvent) {
              JOptionPane.showInternalInputDialog((JButton)anEvent.getSource(), "What
      is your name?");
            }
          });

          final JButton rightFrameButton = new JButton(new AbstractAction("Show
      Internal Input Dialog...") {
            public void actionPerformed(ActionEvent anEvent) {
              JOptionPane.showInternalInputDialog((JButton)anEvent.getSource(), "What
      is your name?");
            }
          });

          JFrame leftFrame = new JFrame();
          leftFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          leftFrame.getContentPane().add(leftFrameButton, BorderLayout.NORTH);
          leftFrame.getContentPane().add(new JButton(new AbstractAction("Show Internal
      Input Dialog in Window...") {
            public void actionPerformed(ActionEvent anEvent) {
              JOptionPane.showInternalInputDialog(windowButton, "What is your name?");
            }
          }), BorderLayout.SOUTH);
          leftFrame.setSize(300, 300);
          leftFrame.setLocation(25, 100);
          leftFrame.setVisible(true);

          JWindow window = new JWindow();
          window.getContentPane().add(windowButton, BorderLayout.NORTH);
          window.getContentPane().add(new JButton(new AbstractAction("Show Internal
      Input Dialog in Right Frame...") {
            public void actionPerformed(ActionEvent anEvent) {
              JOptionPane.showInternalInputDialog(rightFrameButton, "What is your
      name?");
            }
          }), BorderLayout.SOUTH);
          window.setSize(300, 300);
          window.setLocation(350, 100);
          window.setVisible(true);

          JFrame rightFrame = new JFrame();
          rightFrame.getContentPane().add(rightFrameButton, BorderLayout.NORTH);
          rightFrame.getContentPane().add(new JButton(new AbstractAction("Show
      Internal Input Dialog in Left Frame...") {
            public void actionPerformed(ActionEvent anEvent) {
              JOptionPane.showInternalInputDialog(leftFrameButton, "What is your
      name?");
            }
          }), BorderLayout.SOUTH);
          rightFrame.setSize(300, 300);
          rightFrame.setLocation(675, 100);
          rightFrame.setVisible(true);
        }
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 280240)
      ======================================================================

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: