File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTable ActionListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable ActionListener" Watch "JTable ActionListener" New topic

JTable ActionListener

aulo aasmaa

Joined: Aug 06, 2001
Posts: 15

JTable with many rows. When user scrolls then the current row number should be displayed on one JLabel.
I have other parts ready, but I don't know how to listen to the JTable.
Current idea that doesn't work:

Would be wery delighted if smb could point out the bug in this code.
[This message has been edited by aulo aasmaa (edited August 09, 2001).]
aulo aasmaa

Joined: Aug 06, 2001
Posts: 15
I now know the reason:
The JLable text is updated right after I press the arrow keys, but the "cursor" is moved after that, ie I have to move to
ListSelectionEvent listener.
I agree. Here's the link:
subject: JTable ActionListener
It's not a secret anymore!