JSlider () { JSlider slider = new JSlider(0, 100); slider.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); slider.setMajorTickSpacing(10); slider.setMinorTickSpacing(1); slider.setPaintTicks(true); slider.setPaintLabels(true); slider.setVisible(false); return slider; }