aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: How to add a horizontal scrallbar to a scrollPane? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: How to add a horizontal scrallbar to a scrollPane?" Watch "NX: How to add a horizontal scrallbar to a scrollPane?" New topic
Author

NX: How to add a horizontal scrallbar to a scrollPane?

Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hi,
I put my table into a ScrollPane, but there isn't horizontal scrallbar, no matter how I do. Thank you for help.
Best, Damu
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

In the Constructor you can pass the scrollbar definitions

JScrollPane(Component view, int vsbPolicy, int hsbPolicy)
Creates a JScrollPane that displays the view component in a viewport whose view position can be controlled with a pair of scrollbars.
JScrollPane(int vsbPolicy, int hsbPolicy)
Creates an empty (no viewport view) JScrollPane with specified scrollbar policies.

The policy is basically Constants that you pass from the "Fields inherited from interface javax.swing.ScrollPaneConstants"

HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER

Mark
[ October 21, 2003: Message edited by: Mark Spritzler ]

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hi Mark, thank you!
I know now:

is the secret!
Best,
Damu
 
Don't get me started about those stupid light bulbs.
 
subject: NX: How to add a horizontal scrallbar to a scrollPane?