Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.BorderLayout;

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

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

        JSlider oneJSlider = new JSlider();

        oneJSlider.setValue(27);

        int value = oneJSlider.getValue();
        System.out.println(value);

        oneJSlider.setPaintTicks(true);

        frame.add(oneJSlider, BorderLayout.NORTH);
        frame.setSize(300, 200);
        frame.setVisible(true);
    }
}