This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Automatic resizing of table cells  RSS feed

 
Tejo Kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have got some problem while resizing the window which has jtable . My requirement is to resize the cells in jtable whenever i resize the window. Can anyone help me in this case...

Thanks in advance,
Tejo Kumar.
 
Kriti Garg
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

give aome information how u r adding JTable to ur window eg,which layout u r using or send ur code.

Kriti
 
Tejo Kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kriti,

I am adding the jtable to internalframe. when i resize the internal frame, the cells in it should also resize.



So, if I resize the internalframe, the columns of sampletable should also resize. Can u plz help me.

Thanks in advance,
Tejo Kumar.
 
Kriti Garg
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)what is this internal fram and where you are opening this frame to?
2) by resizing u mean when frame opens with the help of mouse or by settingSize of ur this internal frame?
 
Tejo Kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Internal frame is just like a frame.
Resizing means, resizing the window using mouse.

Regards,
Tejo Kumar.
 
Kriti Garg
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this

jTable.setAutoResizeMode(jTable.AUTO_RESIZE_ALL_COLUMNS);

and if u want to set it to false set

jTable.setAutoResizeMode(jTable.AUTO_RESIZE_OFF);

hope this will help u out!

Kriti
 
Tejo Kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kriti...

It worked...

Thanks again.
Tejo Kumar.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!