Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable shrinks  RSS feed

 
Skip Cole
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have added a JTable inside a JScrollPane inside a JFrame using a GridBagLayout.
When I add data to my TableModel, using the addRow Method, the size of my JTable suddenly becomes smaller.
Has anyone seen this, or know what I should call to prevent this from happening?
Thanks in advance,
Skip
 
Skip Cole
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the answer to my own question. Really kind of simple, so I figured I'ld put it here.
Set the weightx parameter!
c.weightx = 100;
I was kind of new to Swing and all, otherwise, this should have been obvious.
Skip
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!