JDK-4411197 : Button is pushable even if disabled.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-02-02
  • Updated: 2001-02-02
  • Resolved: 2001-02-02
Related Reports
Duplicate :  
Description

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


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

Comments
EVALUATION This has been fixed with the focus work in Merlin. See bug 4290675 richard.ray@eng 2001-02-02
02-02-2001