This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 78481 - a11y: ESC and Enter do not work in New Wizard after project creation
Summary: a11y: ESC and Enter do not work in New Wizard after project creation
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@uml
URL:
Keywords: A11Y, REGRESSION
Depends on:
Blocks:
 
Reported: 2006-06-20 10:27 UTC by bugbridge
Modified: 2006-11-01 13:31 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-06-20 10:27:38 UTC
Description:
reproducible with coco, not reproducible with buzz

steps to reproduce:
1. start IDE
2. create new Platform Independant Project or Java Platform Project
New Wizard appears
3. press ESC (or Enter)
nothing happens

Evaluation:
The reason the New Wizard does not respond to the ESC key or the Enter Key
because the dailog looses its focus.  As soon as you click on one of the
components of the dialog to gain the focus, the dailog again responds to the key
events.  

The fix for this is not trivial. Still investigating why the focus gets lost
even though the code does set the focus to the Diagram Name text field in
loadComponents() method of NewDiagramUI class.

Workaround:
Click on one of the components of the dialog to gain the focus, then click ESC
or Enter key.
Comment 1 Viktor Lapitski 2006-08-17 05:28:21 UTC
This is a bug in the focus management of jdk 1.5 that is fixed in jdk1.6. 
Thus it is reproducible for Coke on jdk1.5 and not reproducible on jdk1.6.

The bug surfaced due to integration  
http://www.netbeans.org/source/browse/openide/dialogs/src/org/openide/WizardDescriptor.java?r1=1.15&r2=1.16
(specifically by adding of SwingUtilities.invokeLater() wrapping of 
wizard closing at "Line 1687") 

The test case illustrating the jdk bug is below. 

Considering that:

- it is a jdk problem that doesn't exist in the next, publicly available, jdk
version that is among target jdks for the EntPack    
- there is an available easy workaround (mentioned above pressing of "TAB")

the issue is a candidate for "WONTFIX".

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

/**
 * Run, click B0, click B1. 
 * At this moment the dialog "D2" should be active 
 * and the text field inside it should have focus.
 * Try typing something without explicit click on the text field. 
 * Works fine with 1.6 and doesn't work with 1.5. 
 */

public class Test {

    public static void main(String[] argv) {
	final Frame f = new Frame();
	JButton b = new JButton("B0");
	b.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
		    new Dialog1(f).show();		    
		}		
	    });
	f.add(b);
	f.pack();
	f.show();
    }


    public static class Dialog1 extends JDialog {	

	public Dialog1(final Frame owner) {
	    super(owner, true);
	    JButton b1 = new JButton("B1");
	    b1.addActionListener(new ActionListener() {
		    public void actionPerformed(ActionEvent e) {
			SwingUtilities.invokeLater(new Runnable() {
				public void run() {
				    new Dialog2(owner, "D2").show();	
				}
			    });
			SwingUtilities.invokeLater(new Runnable() {
				public void run() {
				    dispose();
				}
			    });
		    }		
		});
	    Panel p = new Panel();
	    p.add(b1);
	    add(p);
	    pack();
	}
    }


    public static class Dialog2 extends JDialog {
	
	public Dialog2(Frame owner, String title) {
	    super(owner, title, true);
	    JTextField tf = new JTextField();
	    add(tf);
	    pack();
	    tf.requestFocus();
	}
    }

}

==========================
Comment 2 Kris Richards 2006-08-23 19:53:37 UTC
I just tested this in coco and the esc and return buttons work fine. Note that I am on a Mac.
Comment 3 Andrew Korostelev 2006-08-24 09:16:08 UTC
please, track coco status in bugster (bug # 6381521).
Comment 4 Andrew Korostelev 2006-08-24 09:17:49 UTC
Bug is still reproducible in coke060821 with jdk1.5_06 under windows.
Comment 5 Andrew Korostelev 2006-08-24 09:25:42 UTC
reproducible with jdk1.5
Comment 6 Andrew Korostelev 2006-10-02 12:20:58 UTC
see also issue 86296
Comment 7 Thuy.d Nguyen 2006-10-27 19:46:28 UTC
The New Diagram Wizard has been rewitten using NetBeans wizard dialog, so the
ESC key does close the dialog as expected. This issue is considered fixed. 
Comment 8 Andrew Korostelev 2006-11-01 13:31:37 UTC
verified in ide-coco-061031_3-ml