MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.awt.BorderLayout;

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

public class MainClass {
    public static void main(String args[]) throws Exception {
        JFrame frame = new JFrame("Filled Slider");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JSlider js1 = new JSlider();
        js1.putClientProperty("JSlider.isFilled", Boolean.TRUE);
        JSlider js2 = new JSlider();
        js2.putClientProperty("JSlider.isFilled", Boolean.FALSE);
        frame.getContentPane().add(js1, BorderLayout.NORTH);
        frame.getContentPane().add(js2, BorderLayout.SOUTH);
        frame.setSize(300, 200);
        frame.setVisible(true);
    }

}