import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JSlider; public class Main { public static void main(String args[]) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSlider oneJSlider = new JSlider(); int tickSpacing = 25; oneJSlider.setMajorTickSpacing(tickSpacing); oneJSlider.setMinorTickSpacing(5); oneJSlider.setPaintTicks(true); frame.add(oneJSlider, BorderLayout.NORTH); frame.setSize(300, 200); frame.setVisible(true); } }