File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Jcombobox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Jcombobox" Watch "Jcombobox" New topic


Bhuvan mehra
Ranch Hand

Joined: Mar 29, 2002
Posts: 69
JComboBox.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent e) {
it is not working. pls. write if i am missing any step.
Uma Y

Joined: Mar 25, 2002
Posts: 7
Here's what the Java Swing tutorial says about JComboBox handling focus event
"Although JComboBox inherits methods to register listeners for low-level events -- focus, key, and mouse events, for example -- we recommend that you don't listen for low-level events on a combo box. Here's why: A combo box is a compound component -- it is comprised of two or more other components. The combo box itself fires high-level events such as action events. Its subcomponents fire low-level events such as mouse, key, and focus events. The low-level events and the subcomponent that fires them are look-and-feel-dependent. To avoid writing look-and-feel-dependent code, you should listen only for high-level events on a compound component such as a combo box."
hope this helps!!
Bhuvan mehra
Ranch Hand

Joined: Mar 29, 2002
Posts: 69
thanks and regards,
I agree. Here's the link:
subject: Jcombobox
It's not a secret anymore!