Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-13-2008, 08:00 AM
Member
 
Join Date: Feb 2008
Posts: 3
birdofprey is on a distinguished road
how to focus to another JTextfield?
If i create an object where the object is return within a private function and added into jContentPane, something like this

jContentPane.add(getTextField1);
jContentPane.add(getTextField2)


Is there it anyway for me to have my cursor focus onto the next JTextfield once the user enter his info for that field?

Once he's done with "getTextField1" hits enter and it will jump to the next field "getTextField2"?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-17-2008, 12:53 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
Java provides for navigation out of a JTextField to the next focusable component in the containment hierarchy by holding down the shift key and pressing the tab key. Pressing the enter key while the cursor is in a JTextField fires an ActionEvent. To override this behavior may be complicated.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 02:08 PM
Member
 
Join Date: Dec 2007
Posts: 8
newmember is on a distinguished road
you can use "getTextField2.grabfocus() " method within keylistener of getTextField1 when key "Enter" is pressed.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
add JToolTip on focus gained forJTextField ismailsaleh AWT / Swing 6 02-01-2008 01:02 PM
JTable Focus Traversal helios_lie AWT / Swing 1 12-20-2007 11:27 AM
set focus to the textfield paty New To Java 1 07-24-2007 01:32 AM
help with JTextfield gary New To Java 4 07-11-2007 02:58 PM
Focus Marty AWT / Swing 1 05-31-2007 03:16 AM


All times are GMT +3. The time now is 05:56 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org