Swithcing between 2 JTables.

K

kjartana

Hello.

I'm writing a swing application that has 2 JTables on seperate
JScrollPane. When data in table 1 is edited I submit it to a database
(using a TableModelListener) and would then like the focus to be set to
table 2.

My problem is setting the focus from table 1 to table 2.

Any help would be much appreciated.
 
V

VisionSet

Hello.

I'm writing a swing application that has 2 JTables on seperate
JScrollPane. When data in table 1 is edited I submit it to a database
(using a TableModelListener) and would then like the focus to be set to
table 2.

My problem is setting the focus from table 1 to table 2.

Any help would be much appreciated.

Not used it myself, but have you tried java.awt.FocusTraversalPolicy?
You should be able to do it so you don't need a reference to the other
table.

<http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top