Example usage for javax.swing JSlider getLabelTable

List of usage examples for javax.swing JSlider getLabelTable

Introduction

In this page you can find the example usage for javax.swing JSlider getLabelTable.

Prototype

@SuppressWarnings("rawtypes")
public Dictionary getLabelTable() 

Source Link

Document

Returns the dictionary of what labels to draw at which values.

Usage

From source file:Main.java

public static void 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(new Integer(slider.getMinimum()), label);
    table.put(new Integer(slider.getMaximum()), label);

    // Force the slider to use the new labels
    slider.setLabelTable(table);// w w w .j av  a  2 s .co  m

}