action event repeats if left mouse click in app screen after dismiss a dialog bo

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P5
    • None
    • Affects Version/s: 3.0, 1.1.5, 1.1.8_003, 1.2.2
    • Component/s: client-libs
    • sparc
    • solaris_2.5.1, solaris_7



      We have a button that brings up a dialog box.
      When we dismiss the dialog box and right away click on
      anywhere in the window (except the original button), the
      same button action event is sent. Therefore, it brings up
      the same dialog box again.

      If you would take this sample program to test,
      first you click on 'click' button. It brings up
      a dialog box with message "Testing Action Event" and an 'ok' button.
      Click on OK to dismiss the dialog. Right away, left mouse click
      in main frame. You would see click button being highlighted
      and the same dialog box appears again.

      This is compiled with /usr/dist/share/java,v1.1.5
      and /usr/dist/share/irdk,v1.0/1.1/swingall.jar.

      ===============================================================================
      import com.sun.java.swing.JFrame;
      import com.sun.java.swing.JButton;
      import com.sun.java.swing.JPanel;
      import com.sun.java.swing.JOptionPane;

      import java.awt.event.ActionListener;
      import java.awt.event.ActionEvent;
      import java.awt.BorderLayout;

      public class TestAction extends JFrame implements ActionListener
      {
          JButton click, exit;

          public TestAction()
          {
      super("Test Program");

      getContentPane().setLayout(new BorderLayout());

      JPanel panel = new JPanel();
      click = new JButton("Click");
      exit = new JButton("Exit");

      click.addActionListener(this);
      exit.addActionListener(this);

      panel.add(click);
      panel.add(exit);

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


          public void actionPerformed(ActionEvent ae)
          {
      JButton button = (JButton)(ae.getSource());
      if(button.equals(click))
      {
      JOptionPane.showMessageDialog(this, "Testing Action Event");
      }
      else
      {
      System.exit(0);
      }
          }


          public static void main(String[] args)
          {
      TestAction f = new TestAction();
      f.setVisible(true);
      f.setSize(400, 400);
          }
      }

      jennifer.liang@corp 1998-08-28

            Assignee:
            Oleg Sukhodolsky (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: