<commit_before>//
// $Id: SimpleSlider.java,v 1.2 2002/09/04 01:28:09 shaper Exp $

package com.samskivert.swing;

import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;

import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
 * Displays a slider with a label on the left explaining what the slider
 * does and a label on the right displaying the slider's current value.
 */
public class SimpleSlider extends JPanel
    implements ChangeListener
{
    /**
     * Creates a simple slider with the specified configuration.
     *
     * @param label the text to display to the left of the slider.
     * @param min the slider's minimium value.
     * @param max the slider's maximum value.
     * @param value the slider's starting value.
     */
    public SimpleSlider (String label, int min, int max, int value)
    {
        setLayout(new HGroupLayout(HGroupLayout.STRETCH));
        add(_label = new JLabel(label), HGroupLayout.FIXED);
        add(_slider = new JSlider(min, max, value));
        _slider.addChangeListener(this);
        add(_value = new JLabel(Integer.toString(min)), HGroupLayout.FIXED);
    }

    // documentation inherited<commit_msg>Make the slider component available to allow configuration without having to add wrapper methods to the SimpleSlider itself for every possible slider configuration option.<commit_after>//
// $Id: SimpleSlider.java,v 1.3 2002/10/16 14:55:58 shaper Exp $

package com.samskivert.swing;

import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;

import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
 * Displays a slider with a label on the left explaining what the slider
 * does and a label on the right displaying the slider's current value.
 */
public class SimpleSlider extends JPanel
    implements ChangeListener
{
    /**
     * Creates a simple slider with the specified configuration.
     *
     * @param label the text to display to the left of the slider.
     * @param min the slider's minimium value.
     * @param max the slider's maximum value.
     * @param value the slider's starting value.
     */
    public SimpleSlider (String label, int min, int max, int value)
    {
        setLayout(new HGroupLayout(HGroupLayout.STRETCH));
        add(_label = new JLabel(label), HGroupLayout.FIXED);
        add(_slider = new JSlider(min, max, value));
        _slider.addChangeListener(this);
        add(_value = new JLabel(Integer.toString(min)), HGroupLayout.FIXED);
    }

    /**
     * Returns the slider component.
     */
    public JSlider getSlider ()
    {
        return _slider;
    }

    // documentation inherited
{'fraction_non_alphanumeric': 0.09107402031930334, 'fraction_numerical': 0.011611030478955007, 'mean_word_length': 3.2027439024390243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2769796', 'n_tokens_mistral': 811, 'n_tokens_neox': 777, 'n_words': 271}