This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 19649
    
  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
 
Similar Threads
find function in JTree..urgent!!
Find function in Jtree..urgent!!
Enter key functionality on JTextField
JTable with CellEditor peculiar focus problem
How to set focus on submit button on press of enter key