Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

Swing accelerator keys

Thread view: 
Nick H - 05 Feb 2004 17:45 GMT
Hello,
    I've got a Swing window, and I want something to happen when I press
F2. The closest I can find is getting something to happen when a
particular Component has the focus, but I want it to happen just as long
as the window has focus. I've looked around but I can't find anything
that explains it.

Thanks
Andrew Thompson - 05 Feb 2004 17:52 GMT
> Hello,
> I've got a Swing window, ...

Did you also have a question?
Tor Iver Wilhelmsen - 05 Feb 2004 19:06 GMT
>     I've got a Swing window, and I want something to happen when I
> press F2. The closest I can find is getting something to happen when a
> particular Component has the focus, but I want it to happen just as long
> as the window has focus. I've looked around but I can't find anything
> that explains it.

Use WHEN_IN_FOCUSED_WINDOW. If that doesn't mean anything to you you
need to read the docs more.
Nick H - 06 Feb 2004 12:32 GMT
>>    I've got a Swing window, and I want something to happen when I
>>press F2. The closest I can find is getting something to happen when a
[quoted text clipped - 4 lines]
> Use WHEN_IN_FOCUSED_WINDOW. If that doesn't mean anything to you you
> need to read the docs more.

...i need to read the docs...

Signature

Nick H

Nick H - 06 Feb 2004 12:48 GMT
>>>     I've got a Swing window, and I want something to happen when I
>>> press F2. The closest I can find is getting something to happen when a
[quoted text clipped - 3 lines]
>
> ...i need to read the docs...

I looked it up, and the registerKeyboardAction that uses it is now
obsolete. I'll use getActionMap() and getInputMap() instead... maybe you
should read the docs more!

Signature

Nick H

Thomas Fritsch - 06 Feb 2004 13:24 GMT
>>>     I've got a Swing window, and I want something to happen when I
>>> press F2. The closest I can find is getting something to happen when a
[quoted text clipped - 7 lines]
>
> ...i need to read the docs...

Start reading the docs for the methods JComponent#registerKeyboardAction,
continue for the docs of related methods/classes as needed, and put the
bricks together...

______________________________________________________
Thomas <dot> Fritsch <at> ops <dot> de


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.