jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes JTable ListSelectionListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable ListSelectionListener" Watch "JTable ListSelectionListener" New topic

JTable ListSelectionListener

Alex Kravets
Ranch Hand

Joined: Jan 24, 2001
Posts: 476
I have three JTables stacked one on the top of other. Only lower JTable has horizontal scroll bar and listener is attached to it. When this scroll bar is scrolled, the other two top tables scroll as well:

However, when I use arrow keys to move within the table the listener no longer works because I am not using scroll bar. Now I got another listener from sun's website that detects when table is being scrolled with arrow and I get the current column selected, but how do I apply this information to other two tables?


[ April 04, 2005: Message edited by: Alex Kravets ]

[ April 04, 2005: Message edited by: Alex Kravets ]
[ April 04, 2005: Message edited by: Alex Kravets ]

All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
don't know if this will work in JTables, but worth a try
(the 'pad' part is just to trigger the horizontal scrollbar)

I agree. Here's the link: http://aspose.com/file-tools
subject: JTable ListSelectionListener
It's not a secret anymore!