wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic
Author

JTable

zoe goddard
Ranch Hand

Joined: Dec 12, 2000
Posts: 74
I have a JTable. When a row is clicked on I want to be able to get the value of column "A". This works. The problem occurs when the user moves the column "A" around, such that the order would be "B", "C", "A", "D". I tried this :

table.getValueAt(table.getSelectedRow(),
table.getColumn("A").getModelIndex());
The problem is that the model index for "A" is always 0.
table.getValue at appears to be using the column number to refer to how the columns appear on the screen.
How would I be able to get the value I want?
Any ideas?

[This message has been edited by zoe goddard (edited June 04, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable
 
Similar Threads
JTable
JTable... Urgent!
JTable
JTable
JTable