This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to remove focus from JFileChooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to remove focus from JFileChooser" Watch "How to remove focus from JFileChooser" New topic
Author

How to remove focus from JFileChooser

Rohit Kumar
Ranch Hand

Joined: Sep 20, 2007
Posts: 53
I have a JPanel on which a JFileChooser is added.
Now the focus (cursor) is always set to TextBox, which contains the file we choose from file chooser.

Now the problem is, I have to capture a key on this panel.
But as the cursor always on the text box of JFileChooser, the key pressed event is not fired.
If i remove the JFileChooser, the keyPressed event is fired.

How to fire a keyPressed event when JFileChooser is there on the panel, and i press a key.

Is there any way to remove focus from the text box?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
for those interested in trying to assist in the stated problem,
reply #4 is worth a look
http://forums.sun.com/thread.jspa?threadID=5333135&tstart=0

(posted 7+ hours earlier than this post/reply)
 
Consider Paul's rocket mass heater.
 
subject: How to remove focus from JFileChooser
 
Similar Threads
Remove focus
Issues when popup a dialog from keyReleased event
Text field validation
Accessibility
Focus Lost throws error