Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 12th, 2007, 07:31 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Move next input field automatically

I have a frame containing multiple JTextField for input of 5 characters in each field. I move to next input area by Tab or mouse. I want to move next input area, when I have keyed in 5 characters, automatically. But How?. Solution is requested.

Reply With Quote
  #2 (permalink)  
Old November 13th, 2007, 09:52 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try to use KeyListener or KeyAdapter classes from java.awt.event package and add this listener to your text fields using addKeyListener() method of JTextField. Override the keyTyped() method of KeyListener and check the text length of the text field. If it is equal to the 5 char. then use the requestFocus() on the target text field to get the focus. I think it will solve your problem.


- Rakesh
Reply With Quote
  #3 (permalink)  
Old November 16th, 2007, 12:36 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Rakesh Mscit for giving solution.

Reply With Quote
  #4 (permalink)  
Old November 16th, 2007, 09:27 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Most welcome


- Rakesh
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Move cursor to beginning of field in form Odeh Naber Access 3 June 5th, 2007 04:21 PM
value properties in INPUT field roccosiffredi Ajax 2 May 6th, 2007 05:15 PM
Move focus to field without selecting text echovue Access VBA 1 April 12th, 2006 01:52 AM
Automatically select value from a calculated field jimmy0305 Access 0 June 21st, 2005 10:43 AM
info from one field to another automatically miller2000 Access 6 June 18th, 2004 08:59 AM



All times are GMT -4. The time now is 03:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.