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 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" Watch "JTable" New topic


Helen Wallace

Joined: Jul 02, 2007
Posts: 7
Hi all,

I have a problem with JTable. I have a table from which I get the value of a particular cell from the selected row thus:

The problem is I thought that by using the column name instead of an integer to get the column from the table I would avoid the problem of getting the wrong column if the columns were moved around table. This is not so. When I move the columns around I get the wrong column from the table and hence the wrong value from the row. Am I doing something obviously wrong here?

Is there for instance something I'm missing in the table model:


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I agree. Here's the link:
subject: JTable
It's not a secret anymore!