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 Enter key functionality on JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

Enter key functionality on JTextField

Rajesh k Jha
Ranch Hand

Joined: May 10, 2009
Posts: 72
Hello to everyone,

I have one problem with the functionality of Enter key on JTextField.
Actually i have one "Form" where i have used JPanel which is scrollable, so to fill complete form i have to use scrollbar.
Now what i want is on press of "enter key",
i) Focus should transfer to the next textfield.
ii) And at the same time it should scroll down to show the next textfield.
I have achieved the focus functionality of JtextField to transfer the focus on the next TextField but not getting solution of scrolling down.

For review i am posting my code.

This code is to move the focus to the next JTextField



Now what to add extra code to Scroll down ?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Once is enough, thank you. UseOneThreadPerQuestion.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enter key functionality on JTextField