new JScrollBar(int orientation)
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JScrollBar;
public class MainClass {
public static void main(String args[]) throws Exception {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JScrollBar oneJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
frame.add(oneJScrollBar, BorderLayout.NORTH);
frame.setSize(200, 44);
frame.setVisible(true);
}
}
Related examples in the same category