1

How can I calculate the dimenstions of the cell in JTable containing various components to calculate the height of table dynamically.

For example, I have a table containing multiple checkboxes in the 3rd column and various components in other columns. When new components are added to the cell, then the height and width of the whole table should change dynamically.

Thanks in advance.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
deva
  • 141
  • 1
  • 1
  • 9
  • You seem to ask questions without putting any effort. Could you consider telling us what you've tried at least? Or considered trying? – aLearner Dec 20 '12 at 07:19
  • @aLearner: Dude i am new to swing and am trying my best, but can't find solutin.. – deva Dec 20 '12 at 07:26

1 Answers1

2

You might be able to leverage the approach shown here, which invokes setRowHeight() to accommodate the maximal height of each column's renderer.

image

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045