Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Increasing the size of the Panel

 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use setPreferredSize(). This is the size scroll panes will use to determine whether or not to display any scroll bars.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic