Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

refresh a jtable and columns

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is there a way to get the current column widths
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
reply
    Bookmark Topic Watch Topic
  • New Topic