File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable selected Data not updated Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JTable selected Data not updated" Watch "JTable selected Data not updated" New topic
Author

JTable selected Data not updated

Suraj Panda
Greenhorn

Joined: Jul 20, 2012
Posts: 2
I have set data to jTable using DataModel, & want to perform CRUD operations.
But the problem is that IF click first & then sort the table data using rowsorter, then the previous selected value is retained.

Help me to update the currentselection value after sorting.


Reply appreciated


Thanks,
Suraj
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
not really sure what the stated problem is, but a couple of methods of the rowSorter might suit

convertRowIndexToModel
convertRowIndexToView
Suraj Panda
Greenhorn

Joined: Jul 20, 2012
Posts: 2
Thanks for the suggestion. Have a look at my issue & help me...

After displaying data in JTable, Suppose i click on a row & then sort the row by clicking on the JTable header. After sorting, I click on update/delete button to edit the current selected user data.
But the data is coming at the row number while I clicked instead of actual row selected.

Ex:

Suppose I click on row num: 3 to update & then sort the row data. After sorting row num :3 comes to position : 6 . But while clicking on update button it takes the data of current row which is in row num: 3 instead of actual row num: 6.



Please suggest.

Thanks
Suraj
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
what happened when you looked into the suggested methods?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JTable selected Data not updated
 
Similar Threads
JTable
JTable
JTable
JTable
JTable