Menu Removes Focus
2 Message(s) by 2 Author(s) originally posted in java gui
| From: Jason Cavett |
Date: Friday, October 12, 2007
|
I'm curious - how do I know what
component has focus when I need to
pop up a
menu to
complete a task.
For example, in my JTree, I have a popup menu that comes up when I
right
click on the tree. Well, the JTree is the "
real "
object that
has focus (for a paste/cut/copy/whatever), but now that the menu is
shown, JAVA thinks it is the thing to have the real focus.
Hopefully that makes sense.Thanks
| From: Steve W. Jackson |
Date: Monday, October 15, 2007
|
In article
<1192199555.846573.118100@xxxxxxxxxxx>,
wrote in message:
I'm curious - how do I know what component has focus when I need to
pop up a menu to complete a task.
For example, in my JTree, I have a popup menu that comes up when I
right click on the tree. Well, the JTree is the "real" object that
has focus (for a paste/cut/copy/whatever), but now that the menu is
shown, JAVA thinks it is the thing to have the real focus.
Hopefully that makes sense.
Thanks
The popup really is the item with "real" focus in this case. Only one
component at any time can have "the focus" in your application. When a
popup is displayed, it's a window of a
sort and deactivates the one
containing your tree. But you will find in the
API (application
programming interface)for Window (one of the
superclasses to JDialog and JFrame) that there's a
method named
getMostRecentFocusOwner which will identify the Component owning the
focus when the window regains focus.
HTH,
= Steve =
--
Steve W. Jackson
Montgomery, Alabama
Next Message: Revive tame page
Blogs related to Menu Removes Focus
basically i have two multiple select box im doing a add button so ...
i’m having an issue with this
javascript menu class i’m using (in IE 7). if i activate the
menu a floating div layer is created, when i open another window on the desktop the div layer remains on the ‘top’ of the desktop even though i’m
...
Minimalist Website Design Patterns
While this is a product site and the use of images is necessary Apple goes a bit far by adding a graphical
menu, a
javascript gallery box with images of all of their mac products, graphical buttons and page headings.
...
Samsung E950 Review
7. Samsung has included Data cable and a 512MB card in the retail package 8. Nice web browser but office documents viewer is slow 9. But Choppy animation in the main
menu and
Java applications can be installed only through WAP.
...
jason behr photo
jay z renagade
javascript text
menu jennie lynn hayden jaguar dealerships atlanta
java messaging server system jinlun jl50qt 4 jona jet jobs in south african airways kristen stewart cold creek manor joe and play walking the floor
...
Getting the Most out of Animation School
You may decide you’d like to
move into one of these roles after you gain some animation experience. Before you enter the job market, take advantage of your animation school resources to learn more about the industry. The
focus will help
...
Applet
Java applet on computer that reads serial data and stores it into a file. Click HERE for the applet thelinuxmovement.blogspot: How has a main
menu applet which was pretty cool. But now tehkain from the awn forums has created another
...