• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JTable is not fit to the screen width.

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JTable is not displayed to the full width of the screen.
I am using AUTO_RESIZE_OFF option in setAutoResizeMode(JTable.AUTO_RESIZE_OFF); API.
It makes the JTable to shrink fit to the screen and not fit to the entire width of the screen.

Any thoughts please to make the JTable to fit completely to the width of the screen?

Thanks in advance,
Rajakumar K
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you laying out the window? The overall size of a JTable is going to be controlled by the layout managers that you are using. The AUTO_RESIZE affects the width of the columns, not the overall size.
 
Rajakumar Kasi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matthew,
Thanks a lot for your quick response.
I did not set any layout manager explicitly to my JTable.
May I know the layout manager which fit the JTable to the complete width of the screen.
 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't crosspost. Instead, CarefullyChooseOneForum.

Crossposted here: http://www.java-forums.org/awt-swing/33415-jtable-not-fit-screen-width.html
And here: http://forums.oracle.com/forums/thread.jspa?threadID=1556851&tstart=0
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BeForthrightWhenCrossPostingToOtherSites
http://forums.oracle.com/forums/thread.jspa?threadID=1556851

Same answer there, too.

edit And the same answer in
http://www.java-forums.org/awt-swing/33415-jtable-not-fit-screen-width.html

edit2 Drat, beaten by a second. Do I get a silver medal?
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Kevin, you missed one
http://www.javaprogrammingforums.com/awt-java-swing/5528-jtable-not-fit-screen-width.html
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rajakumar Kasi wrote:May I know the layout manager which fit the JTable to the complete width of the screen.



I'd probably use a BorderLayout, but it depends on what the rest of the screen layout is. I'd suggest going through the Layout Manager tutorial to get an idea of what they can all do.

 
Kevin Workman
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:Hey Kevin, you missed one
http://www.javaprogrammingforums.com/awt-java-swing/5528-jtable-not-fit-screen-width.html



I didn't even know about those forums! Looks like I'm going to have to add that to my growing list of forums to keep track of!
 
Rajakumar Kasi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I relatively new to this forum practice and hardly I posted 2 or 3 threads so far. I feel sorry for my unfair crossposting practice. I continue only at http://www.java-forums.org/awt-swing/33415-jtable-not-fit-screen-width.html#post148843
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kevin Workman wrote:

Darryl Burke wrote:Hey Kevin, you missed one
http://www.javaprogrammingforums.com/awt-java-swing/5528-jtable-not-fit-screen-width.html



I didn't even know about those forums! Looks like I'm going to have to add that to my growing list of forums to keep track of!


Just use Google to find the cross posts and sign up everywhere with the same username and password. I've lost track of how many forums I've joined that way

Bartenders, please feel free to delete this OT conversation.
 
Rajakumar Kasi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to delete this thread?
 
Sheriff
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't. If you don't want it anymore, just let it die slowly. Without replies it will drop to the bottom of the first forum page, then move to the second, etc, until the search is the only way to find it.
 
Rajakumar Kasi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prime,
Thanks a lot.
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic