This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Increasing the size of the Panel" Watch "Increasing the size of the Panel" New topic
Author

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 size...so,i want to increase the size of the panel dynamically..
Do its possible?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19911
    
  23

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Increasing the size of the Panel