File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to use Tab & Shift-Tab to move between text input fields? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to use Tab & Shift-Tab to move between text input fields?" Watch "How to use Tab & Shift-Tab to move between text input fields?" New topic
Author

How to use Tab & Shift-Tab to move between text input fields?

Michael Custer
Greenhorn

Joined: Apr 25, 2004
Posts: 6
Geez...
I have 20 input fields and must leave the keyboard
and click with the mouse to move to the next field.

Annoying and, I think, prob unnecessary.
Simply cannot find example code anywhere...


oorik
James Lollar
Greenhorn

Joined: Apr 24, 2004
Posts: 4
How about a for loop, inside a class that takes your table input.. something like (maybe)
import java.io.*;
public class InputHelp{
public String getTheInput(String promptUser){
String userInput = null;
for (integer iv=0;iv<20;iv++){
// prompt user
try {
BufferedRead is new BufferedReader{
//get the line
//test the line for length
} // catch the exception
} // end for
return userInput;
}
}
//the prompt user would hold a System.out.print or prinln, looping for your
input
just a guess
JL
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Michael Custer
Greenhorn

Joined: Apr 25, 2004
Posts: 6
Never mind...
Thanks for the help but I found
something much simpler...

Now, simply add the on-key-press event handler inside the tags as follows:
(Notice how I've added hyphens to the keyword on-key-press). This script
doesn't seem to like the real word... Remove the hyphens, lol.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Actually, this is an HTML/Javascript question. But I can see how this might look like a Swing question. It would have helped if Michael had mentioned it was a web form and not a Desktop GUI form...Moving again.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use Tab & Shift-Tab to move between text input fields?
 
Similar Threads
Batch inserts exception getting thrown..
want to skip focus from an image.
JTable Tabbing
selectALL()
what is the contrary event of "onFocus" ?