• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Automatic resizing of table cells

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kriti...

It worked...

Thanks again.
Tejo Kumar.
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic