• Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding Scrollbar to JPanel  RSS feed

 
Shashidhar Yarabati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JPanel. And in my application if resize the frame some fields in JPanel gets dissappeared.

Can any body tell me how to add Scrollbar to my JPanel so that the user can scroll for the items.

Please help me...
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JScrollPane for adding scrollbar to your panel
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
satishkumar is correct - just wrap the JPanel (or any component!) in a JScrollPane. You can also look at the JScrollPane API if you only want horizontal or vertical scroll bars.
 
Shashidhar Yarabati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys.
I will try it out
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!