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

REGRESSION: JComboBox can't be selected with the Mouse in a modal dialog

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.0, 1.4.2
    • client-libs
    • x86
    • windows_nt, windows_2000



      Name: rmT116609 Date: 08/28/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)


      Please run the following program:
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class JComboBoxBug
      {
      static JDialog dialog=new JDialog();
      static JLabel infoLabel=new JLabel();

      public static void main (String args[])
      {
      dialog.setTitle("JComboBoxBug");
      dialog.setModal(true);

      JComboBox box=new JComboBox();
      for(int i=1;i<5;i++)
      {
      // add some entries
      box.addItem("Entry "+i);
      }
      Container cont=dialog.getContentPane();
      cont.setLayout(new BorderLayout());

      JPanel centerPanel=new JPanel();
      JPanel southPanel=new JPanel();
      JButton okButton=new JButton("OK");
      centerPanel.add(infoLabel);
      centerPanel.add(box);
      southPanel.add(okButton);
      okButton.addActionListener(new ActionListener()
      {
      public void actionPerformed(ActionEvent evt)
      {
      dialog.hide();
      }
      });
      cont.add(BorderLayout.CENTER, centerPanel);
      cont.add(BorderLayout.SOUTH, southPanel);
      infoLabel.setText("Please select something using your mouse and then click ok.");
      dialog.pack();
      dialog.show();
       infoLabel.setText("Now try selecting something different with your mouse again. It won't work in JDK 1.4 Beta1/2 (regression). JDK 1.3.1 works fine. Key-Selection still works.");
      dialog.pack();
      dialog.show();
      System.exit(0);
      }
      }

      The used JComboBox can't be selected with the mouse anymore when the modal
      dialog is displayed for the second time. Keyboard-Selection (Cursor-up/down)
      still works as expected.

      This is a regression from jdk1.3.1 where this code works without problems.
      (Review ID: 130838)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: