wood burning stoves
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

JScrollPane cuts off table

mabel foo

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: 10744

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: 2372
You need to give a hint to the scrollPane about how big you want the viewport to be:

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: JScrollPane cuts off table
It's not a secret anymore!