1

In my project,i need to adjust the sizes of columns in JTable as per the sizes of GUI Components such as JComboBox and JTextField. Can we adjust the size of column as per the size of GUI Component ?

Hungry Blue Dev
  • 1,313
  • 16
  • 30
FullStack
  • 665
  • 11
  • 26
  • 1
    Did u take a look at [this](http://docs.oracle.com/javase/6/docs/api/javax/swing/JTable.html)? – Hungry Blue Dev Mar 01 '14 at 11:45
  • No i didn't,i just tried to get the size of component and set to the column but the size of column seems to be in pixels so it didn't worked,i will take a look at mentioned link. – FullStack Mar 01 '14 at 11:53
  • See [TableColumn](http://docs.oracle.com/javase/7/docs/api/index.html). And see [Here](http://stackoverflow.com/q/19012691/2587435) – Paul Samsotha Mar 01 '14 at 12:00

1 Answers1

1

but the size of column seems to be in pixels

What is the problem with that? The size of Swing components are also in pixels.

See the section from the Swing tutorial on Setting and Changing Column Widths for more information.

camickr
  • 321,443
  • 19
  • 166
  • 288