wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes refresh a jtable and columns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "refresh a jtable and columns" Watch "refresh a jtable and columns" New topic
Author

refresh a jtable and columns

keiyia jackson
Ranch Hand

Joined: Jul 16, 2001
Posts: 49
i have a gui that has a refresh menu item. it refreshes by resubmitting the query. my is problem is that once i refrsh, it changes the size of my columns to a chaaracter wide. any suggestions on how to keep my current column width even if the user resizes them.
keiyia jackson
Ranch Hand

Joined: Jul 16, 2001
Posts: 49
is there a way to get the current column widths
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Well what i feel is Dont add the Listbox directly to JPanel . Add it to JScrollPane and then add the JScrollPane to the JFrame or JPanel.
The size of ur listbox reamins static.and if the values are much longer than the size of the Listbox then automatically a scrollbar will come.
------------------
Try and Try Till u succeed
Sandeep Jain


Try and Try Till u succeed<br /> <br />Sandeep Jain
Sayuri Coppinger
Greenhorn

Joined: Jun 06, 2001
Posts: 20
I had the same problem, and I resolved by calling the setAutoCreateColumnsFromModel(false). The default is to always create the columns from the model. So whenever the model changes, the columns get resized...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refresh a jtable and columns