File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


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: 19697
    
  20

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
 
GeeCON Prague 2014
 
subject: Increasing the size of the Panel