The moose likes Swing / AWT / SWT and the fly likes JPanel scroll bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel scroll bar" Watch "JPanel scroll bar" New topic

JPanel scroll bar

Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
I cant find how to set scroll bar in a JPanel...

or i should just use JPanel and make it the ScrollPane's client like this: ?

JPanel p= new JPanel();
JScrollPane scrollPane = new JScrollPane(p);

Can it works?
I mean i have a lot of components inside p JPanel.
anyone give idea please.
ps: i want a small panel which has scroll bar vertically INSIDE a big panel.

From NickyEng
Diploma in Computer Studies
SCJP 1.4
Formula 1 app by Maxis (Playbook)
prashant gour
Ranch Hand

Joined: Feb 07, 2006
Posts: 45
that will can add panel to scroll pane. No problem
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
thank you.
my problem solved last nite tho.
I agree. Here's the link:
subject: JPanel scroll bar
It's not a secret anymore!