BoundedRangeModelInJSlider.java Source code

Java tutorial

Introduction

Here is the source code for BoundedRangeModelInJSlider.java

Source

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JSlider;

public class BoundedRangeModelInJSlider {
    public static void main(String args[]) {
        JFrame frame = new JFrame("Tick Slider");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JSlider oneJSlider = new JSlider();

        System.out.println(oneJSlider.getModel().getMaximum());

        frame.add(oneJSlider, BorderLayout.NORTH);

        frame.setSize(300, 200);
        frame.setVisible(true);
    }
}