Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2007, 07:31 AM
Authorized User
 
Join Date: Sep 2006
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.

 
Old November 13th, 2007, 09:52 AM
Friend of Wrox
 
Join Date: Mar 2007
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
 
Old November 16th, 2007, 12:36 AM
Authorized User
 
Join Date: Sep 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Rakesh Mscit for giving solution.

 
Old November 16th, 2007, 09:27 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Most welcome


- Rakesh





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.