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

Button is pushable even if disabled.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.1
    • client-libs
    • x86
    • windows_nt



      Name: asR10013 Date: 02/02/2001



      Bug description ---> It's still possible to push a button even if disabled
      by pressing space-bar if the button has a focus being disabled.
      ****************************************************************************
      Failing Test:
      =============


      JCK :
      =====

      Test source location:
      ====================

      Platforms:
      =============
      Windows NT 4.0
      Windows 95


      JDK, switches Info:
      ===================
      java version "1.3.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-beta-b15)
      Java HotSpot(TM) Client VM (build 1.3.1beta-b15, mixed mode)

      jtr file location:
      ==================

      How to reproduce:
      ====================
      The following test example creates a frame window that contains a button.
      Pressing SpaceBar on the button will invert enabled/disabled state of the button.

      To reproduce bug do the following steps:
      1. Compile and run program.
      2. Ensure the button has a focus.
      3. Strike SpaceBar several times.


      Source
      ======
      //---------------------------- test.java --------------------------------------------
      import java.awt.*;
      import java.awt.event.*;

      public class test extends Frame implements ActionListener{
          static Button aBtn;
          public static void main( String[] args ) throws Exception {
              test f = new test();
      f.setSize(300, 300);
      f.add( aBtn = new Button( "Strike SpaceBar, please." ) );
      aBtn.addActionListener( f );
      aBtn.setVisible( true );

      f.setVisible( true );
      System.in.read();
      f.dispose();
      System.exit(0);
          };
          public void actionPerformed(ActionEvent e) {
              if( e.getSource() instanceof Button ) {
      aBtn.setEnabled( !aBtn.isEnabled() );
      };
          };
      };
      //---------------------------- end test.java --------------------------------------------

      Test output:
      =============

      Specific Machine Info:
      =====================
      hostname: linux-11

      Additional JCK related info:
      ============================
      URL to find JCK test owners: http://javaweb.eng/jck/usr/owners.jto


      ======================================================================

            rraysunw Richard Ray (Inactive)
            alssunw Als Als (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: