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 2005

Tip: Looking for answers? Try searching our database.

Moving through the components with the Enter?

Thread view: 
Dado - 26 Feb 2005 16:44 GMT
I have a few components in a JFrame: JTextField, JTree, JTable.
What listener and how I must create it in a JFrame, to
get focus on a next component, with my order list? Enter(or tab) will be a
suitable key.
Thank you
Wiseguy - 26 Feb 2005 21:18 GMT
Dado <mario_zupan@inet.hr> scribbled on the stall wall:

> I have a few components in a JFrame: JTextField, JTree, JTable.
> What listener and how I must create it in a JFrame, to
> get focus on a next component, with my order list? Enter(or tab) will be a
> suitable key.
> Thank you

One way is a keylistener for each component.  when it sees the return
key it changes focus to the next component in the frame.

What's wrong with the <tab> key?
John McGrath - 27 Feb 2005 04:57 GMT
> I have a few components in a JFrame: JTextField, JTree, JTable.
> What listener and how I must create it in a JFrame, to
> get focus on a next component, with my order list? Enter(or tab) will be
> a suitable key.

The TAB key should change focus to the next component automatically.  You
should not need to do anything to make this work.  You can change the keys
that change the keyboard focus using the KeyboardFocusManager.  See the
setDefaultFocusTraversalKeys() method.

Signature

Regards,

John McGrath



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.