Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in adding Scroll Bar to JPanel.

 
Its Manish
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JPanel which is contained in a JInternalFrame. I have been trying to add Scrollbars to the JPanel but only in vain.

Can someone please help me with this?

I am attaching a part of my code which adds this JPanel to the Internal frame:




This code does not show any scrollbars even when the contents of the JPanel clear exceed its bounds.
 
memati bas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make your panel, which is added into your ScrollPane, have bigger size than ScrollPane's size, so that you scrollBars can appear.
 
memati bas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that this code snippet helps you.
 
amod gole
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi memati bas ,

thanks for giving code,

i have one problem,
i want to add scrollbar to panel,
condition(non editable code) is that i am already created that scrollpane
and i am adding that panel to that scrollpane later
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic