import javax.swing.JScrollPane;
...
// add what you want to scroll, e.g. a JTextArea or JPanel
// other option is VERTICAL_SCROLLBAR_NEVER to turn off bar.
JScrollPane scroller = new JScrollPane( jtextArea,
                                        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );

// control the speed effect of the wheelmouse
scroller.getVerticalScrollBar().setUnitIncrement( 16 );

// Using the default VERTICAL_SCROLLBAR_AS_NEEDED will use scrollbars even when
// not strictly needed.  If you want precise control you must decide for yourself
// dynamically.
scroller.setVerticalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );