This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

setting a particular column width and rest should be of default size..

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to to fix the width of a particular column with some predefined size and it should be resizable while other columns widths should be resizable.

I tried by using



//It resizes all columns
empTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

// To resize a particluar column
empTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
int vColIndex = 1;
javax.swing.table.TableColumn tableColumn = tableActivePlans.getColumnModel().getColumn(vColIndex);
int width = 20;
tableColumn.setPreferredWidth(width);

But here the other columns are not of default size and scroll bar is getting created and last columns are getting minimum size,which will happen. But I need rest columns to be of same size.

Thanks,
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic