Determine if currently painting labels for JSlider in Java

Description

The following code shows how to determine if currently painting labels for JSlider.

Example


  //  w w w  .  j  a v  a2 s  .c om

import javax.swing.JSlider;

public class Main {
  public static void main(String[] argv) throws Exception {
    JSlider slider = new JSlider();

    boolean b = slider.getPaintLabels(); 
    System.out.println(b);
    // Paint labels at the major ticks - 0, 25, 50, 75, and 100
    slider.setPaintLabels(true);
    
    b = slider.getPaintLabels(); 
    System.out.println(b);
  }
}




















Home »
  Java Tutorial »
    Swing »




Action
Border
Color Chooser
Drag and Drop
Event
Font Chooser
JButton
JCheckBox
JComboBox
JDialog
JEditorPane
JFileChooser
JFormattedText
JFrame
JLabel
JList
JOptionPane
JPasswordField
JProgressBar
JRadioButton
JScrollBar
JScrollPane
JSeparator
JSlider
JSpinner
JSplitPane
JTabbedPane
JTable
JTextArea
JTextField
JTextPane
JToggleButton
JToolTip
JTree
Layout
Menu
Timer