[SWINGX-1408] JXDatePicker preventing ENTER from passing through Created: 19/May/09  Updated: 30/Mar/11

Status: Open
Project: swingx
Component/s: Calendar
Affects Version/s: 1.6.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jaqq Assignee: kleopatra
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes
Environment:

Operating System: Windows XP
Platform: PC


Issuezilla Id: 68

 Description   

The following frame has a JXDatePicker and a DefaultButton. If the JXDatePicker has
the focus, then ENTER keystrokes are blocked and cannot reach the default button.

[code]
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JFrame;
import javax.swing.UIManager;
import org.jdesktop.swingx.JXDatePicker;

public class FocusTest extends JFrame{
public FocusTest(){
getContentPane().setLayout(new FlowLayout());
getContentPane().add(new JTextField("-------------"));
getContentPane().add(new JXDatePicker());
JButton button=new JButton(new AbstractAction("Default Button") {
public void actionPerformed(ActionEvent e)

{ System.out.println(e); }

});
getContentPane().add(button);
getRootPane().setDefaultButton(button);
pack();
}
public static void main(String args[]) {
try

{ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }

catch (Exception e)

{ e.printStackTrace(); }

java.awt.EventQueue.invokeLater(new Runnable() {
public void run()

{ new FocusTest().setVisible(true); }

});
}
}
[/code]

I could only try the code on a XP machine, don't know about other OSes...


Generated at Thu Jul 02 10:18:57 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.