0

I am using JXtable in my project.When I double click some column,it will be expanded or contracted to the highest character cell in that column.
Is there any way of creating JXtable so that all its columns shall be resized to the size of its highest character cell.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
svkvvenky
  • 1,122
  • 1
  • 15
  • 21

2 Answers2

1

I'm not sure I understand correctly, but to programmatically resize all columns according to their contents you can use JXTable.packAll();.

packAll() Javadoc:

public void packAll()

Resizes all columns to fit their content.

By default this method is bound to the pack all columns Action and registered in the table's ActionMap.

This will make the column with the "broadest" content the biggest, the column with the second "broadest" content the second biggest and so on. I am using it in my projects and it works quite well.

Resizing can also be achieved by clicking on the according menu item from the table controls.

domids
  • 515
  • 5
  • 21
0

You can use the Table Column Adjuster which will automatically adjust the width of a column any time the data is changed.

camickr
  • 321,443
  • 19
  • 166
  • 288