Forums Register Login

Auto resize column of jtable

+Pie Number of slices to send: Send
hello everybody there,
I have almost completed my assignment but i have a problem regarding the jtable columns width.
In my design i use Abstracttablemodel for my jtable.I am using "Auto_resize_all_columns" property so as to fit all the cols in the table.
I have a method called "displayInformation()" in the model which has an vector which holds the value retrive from the database.I have used the "fireTableChanged(null)" method to refresh the data on data change.
Now the problem is that whenever an actionevent occurs like "button action" or "list selection event", my columns take
fix width and are out of the jtable viewable region. since i am using "autoresizing" the horizontal bar of the scrollbar never appears and hence i cant see my two cols.
now if i remove my "firexxx" method the table follows the autoresize policy but my table doesnt gets refresh.
Could any one help me on how to both refresh my table as wll as follow the autoresize mode.
thanks
devu.
+Pie Number of slices to send: Send
Hi Devu
have you considered using the AbstractTableModel fireTableDataChanged trigger to notifies all listeners that, all cell values in the table's rows may have changed. instad of using
fireTableChanged event.
Regards
SMK Reddy
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2906 times.
Similar Threads
JTable
Swing--JTable in JInternalFrame
JTable
JTable problems
JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:53:34.