Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.FlowLayout;
import java.awt.event.KeyEvent;

import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class Main {

    public static void main(String[] args) {
        JCheckBox a = new JCheckBox("A");
        a.setSelected(true);
        a.setMnemonic(KeyEvent.VK_A);

        JCheckBox b = new JCheckBox("B");
        JCheckBox c = new JCheckBox("C");
        JCheckBox d = new JCheckBox("D");

        JFrame frame = new JFrame();
        frame.setLayout(new FlowLayout());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.add(new JLabel("Car Features"));
        frame.add(a);
        frame.add(b);
        frame.add(c);
        frame.add(d);
        frame.pack();
        frame.setVisible(true);
    }
}