aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes FocusListner not working on JMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "FocusListner not working on JMenu" Watch "FocusListner not working on JMenu" New topic
Author

FocusListner not working on JMenu

rohit sen
Greenhorn

Joined: Jan 25, 2010
Posts: 27
Hi

This is my code. I don't see the focus events when the menu is focussed / unfocussed. Am I missing something here? How can I capture focus events on JMenuItem?



Thanks in advance
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> JMenu mItem

is not a JMenuItem
rohit sen
Greenhorn

Joined: Jan 25, 2010
Posts: 27
Doesn't matter if it is a JMenuItem or JMenu. FocusListener doesn't seem to work on both.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
from the Oracle site

"Menu elements do not receive focus since release 1.4."
rohit sen
Greenhorn

Joined: Jan 25, 2010
Posts: 27
Thanks for that information.
 
jQuery in Action, 2nd edition
 
subject: FocusListner not working on JMenu
 
Similar Threads
focusListener wont work on JComboBox
JComboBox and FocusListener
Issues on focus with composites and their child widgets
requestFocus() is not working across applications
focus of JPanel