• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Auto resize column of jtable

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic