Java examples for Swing:JScrollPane
You can set a policy for a JScrollBar component when you create it
Use one of several constants in the ScrollPaneConstants interface:
These constants are used with the JScrollPane (Object, int, int) constructor.
Here's an example:
JScrollPane scroller = new JScrollPane (textBox,
VERTICAL_SCROLLBAR_ALWAYS,
HORIZONTAL_SCROLLBAR_NEVER);