May be this can help...
import javax.swing.*;
import java.awt.*;
public class TestSlider extends JFrame
{
Container c = getContentPane();
public TestSlider()
{
JSlider slider = new JSlider(0,100);
slider.setForeground(Color.RED);
slider.setMajorTickSpacing(10);
slider.setMinorTickSpacing(5);
slider.setPaintLabels(true);
slider.setPaintTrack(true);
slider.setSnapToTicks(true);
c.add(slider);
setSize(400,400);
setVisible(true);
}
public static void main(
String[] args)
{
TestSlider slider = new TestSlider();
}
}