This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Problem in adding Scroll Bar to JPanel. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem in adding Scroll Bar to JPanel." Watch "Problem in adding Scroll Bar to JPanel." New topic
Author

Problem in adding Scroll Bar to JPanel.

Its Manish
Greenhorn

Joined: Sep 16, 2005
Posts: 1
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

Joined: Jan 29, 2006
Posts: 85
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

Joined: Jan 29, 2006
Posts: 85
I think that this code snippet helps you.
amod gole
Ranch Hand

Joined: Dec 07, 2005
Posts: 83
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in adding Scroll Bar to JPanel.
 
Similar Threads
JPanel & JScrollPane problem
JPanel Problem with JInternaelFrame ?
How to get JScrollPane to go to top left??
Multiple JFrames in 1 Container
JPanel Problem with JInternalFrame ?