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

Regression: JButton unclickable in Windows L&F (J2SDK(SE)1.3RA)

XMLWordPrintable



      Name: krT82822 Date: 10/12/99


      10/12/99 eval1127@eng -- this is an RA (build "I" of 1.3.0) regression -- it works fine in 1.3 beta build "O".

      In the code below, the JButton cannot be clicked using the mouse. If the line that sets the Windows L&F is commented out, the JButton can be clicked. Either way, the keyboard can be used to click the button.


      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class Test extends JFrame implements ActionListener
      {
      public Test()
      {
      super("test");
      try {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
      } catch (Exception ex) {
      System.out.println("Error setting L&F");
      }
      setBounds(new Rectangle(100,100,100,100));
      JButton imaButton = new JButton("JButton");
      imaButton.setMnemonic('j');
      imaButton.addActionListener(this);
      getContentPane().add("Center", imaButton);
      setVisible(true);
      }

      public static void main(String[] args)
      {
      try {
      Test test = new Test();
      }
      catch (Exception ex) {
      ex.printStackTrace();
      }
      }

      public void actionPerformed(ActionEvent e)
      {
      System.out.println(((JButton)e.getSource()).getText()+" Clicked!!!");
      }


      }
      (Review ID: 96429)
      ======================================================================

      Name: skT88420 Date: 10/12/99


      My application fails to respond to mouse clicks in any buttons (dialogs, window sizing icons, tool buttons).

      This can be observed by running the SwingSet app. With the Java look & feel, go to the "Buttons" tab and click on the various buttons. You can see the buttons activate in response to the mouse clicks. Change the look and feel to either Motif or Windows (both show this problem). The buttons now receive focus, but they do not activate.
      (Review ID: 96456)
      ======================================================================

            jeff Jeff Dinkins
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: