import java.util.Dictionary;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JSlider;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
JSlider slider = new JSlider();
Dictionary table = slider.getLabelTable();
ImageIcon icon = new ImageIcon("icon.gif");
JLabel label = new JLabel(icon);
// Set at desired positions
table.put(newInteger(slider.getMinimum()), label);
table.put(newInteger(slider.getMaximum()), label);
// Force the slider to use the new labels
slider.setLabelTable(table);
}
}