File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Increasing the size of the Panel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Increasing the size of the Panel" Watch "Increasing the size of the Panel" New topic

Increasing the size of the Panel

shalini gnana
Ranch Hand

Joined: Sep 18, 2007
Posts: 189
In my program,I added the jpanel to the jscrollpane...So,i set the panel size bigger than scrollpane,so that panel scrolls inside the scrollpane...But the problen is when the drawing goes beyond the panel,i want to increase the size of the panel dynamically..
Do its possible?
Rob Spoor

Joined: Oct 27, 2005
Posts: 19755

Just use setPreferredSize(). This is the size scroll panes will use to determine whether or not to display any scroll bars.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Increasing the size of the Panel