Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
ramesh kancherla
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can I change column width and column marzin in JTable.

I have inserted icons in JTable.

can i give individual column size
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ramesh kancherla:
how can I change column width and column marzin in JTable.

I have inserted icons in JTable.

can i give individual column size
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Darryl Burke:
[QB][/QB]


Sorry, first post here, clicked the "Add Reply" prematurely.

You can obtain a TableColumn object reference by calling JTable#getColumn (or JTable#getColumnModel#getColumn) and setPreferredWidth of the TableColumn.

There is no direct concept of "margin" for a TableColumn but you can achieve the desired result by a call to JTable#setIntercellSpacing.

Please consult the API for these methods, and if anything's not clear feel free to ask.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic