This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable is not fit to the screen width. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable is not fit to the screen width." Watch "JTable is not fit to the screen width." New topic
Author

JTable is not fit to the screen width.

Rajakumar Kasi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
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
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

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

Joined: Jan 14, 2009
Posts: 13
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.
Kevin Workman
Ranch Hand

Joined: Sep 28, 2010
Posts: 151
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
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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?


luck, db
There are no new questions, but there may be new answers.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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

Joined: Apr 06, 2010
Posts: 4338
    
    7

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

Joined: Sep 28, 2010
Posts: 151


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

Joined: Jan 14, 2009
Posts: 13
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

Joined: May 03, 2008
Posts: 4523
    
    5

Kevin Workman wrote:


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

Joined: Jan 14, 2009
Posts: 13
how to delete this thread?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rajakumar Kasi
Greenhorn

Joined: Jan 14, 2009
Posts: 13
Prime,
Thanks a lot.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JTable is not fit to the screen width.
 
Similar Threads
Problems with JTable. Need help!!
JTable row
JTable printing . . .
Printing JTable
jtable column size