Results 1 to 5 of 5
Thread: values in jtable
- 11-04-2009, 05:24 PM #1
- 11-04-2009, 05:35 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Your question makes no sense and does not have nearly enough information to make reasonable suggestion. Data is displayed in the order you build the TableModel. If you are using sorting then data is sorted in the appropriate order. If you don't like it ascending, then change the sort order to descending.
- 11-04-2009, 06:09 PM #3
thanks for the reply..
m actually new to the netbeans enviornment.. i have binded JTable component to my database table. while inserting the values from the GUI, i wish to insert it in desc format. can u plz tel me how to change the tablemodel or where to change the the sorting manner?? i tried but couldnt find anything specific!!
- 11-04-2009, 06:44 PM #4
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Well, the classes that bind the table to the database are not core JDK classes so I don't know how they work. But I would guess you need to customize your SQL query to do what you want.
- 11-04-2009, 07:48 PM #5
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
If the JTable is built on a DefaultTableModel,
and if rows are added with its add() method,
switch to the insert() method and put the row where you want it.
This is model-based ordering of the data.
Data can also be ordered strictly within the view.
See JTable.setRowSorter() and the TableRowSorter class.
Similar Threads
-
Sorting JTable on more than just the values listed in the columns
By Jeegen in forum AWT / SwingReplies: 7Last Post: 09-23-2009, 07:28 PM -
inserting values from jtable into database
By sandeepsai17 in forum New To JavaReplies: 1Last Post: 06-29-2009, 07:31 PM -
[SOLVED] Reading values from a jtable
By Manfizy in forum New To JavaReplies: 10Last Post: 05-20-2009, 12:58 PM -
Problem in printing JTable values
By shanssat in forum AWT / SwingReplies: 3Last Post: 02-04-2009, 08:15 AM -
Getting integer values from a JTable
By zikojam in forum New To JavaReplies: 1Last Post: 12-11-2008, 02:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks