Java tutorial
import java.awt.BorderLayout; import java.awt.Container; import javax.swing.JFrame; import javax.swing.JScrollBar; public class ScrollBarPieces { public static void main(String args[]) { JScrollBar oneJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); String title = (args.length == 0 ? "ScrollBar Sample" : args[0]); JFrame frame = new JFrame(title); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container contentPane = frame.getContentPane(); contentPane.add(oneJScrollBar, BorderLayout.NORTH); frame.setSize(200, 44); frame.setVisible(true); } }