aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JScrollPane cuts off table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JScrollPane cuts off table" Watch "JScrollPane cuts off table" New topic
Author

JScrollPane cuts off table

mabel foo
Greenhorn

Joined: Oct 07, 2009
Posts: 8
Hi, I have a JTable inside a JScrollPane and the table gets cut off at the bottom.
The JScrollPane is inside JPanel, and JPanel is inside GridBagLayout.

The table is displayed properly if I remove JScrollPane though.



This is the code for adding JPanel into GridBagLayout.


I've tried using setBounds and setPreferredSize on JScrollPane but it doesn't work.

Please help! Thanks!
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Change to


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2227
    
    8
You need to give a hint to the scrollPane about how big you want the viewport to be:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JScrollPane cuts off table