Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JWindow;

public class Main {
    public static void main(String s[]) {
        JWindow win = new JWindow();

        JPanel pan = new JPanel();
        win.add(pan, "Center");

        pan.setLayout(new FlowLayout());
        pan.add(new JButton("Hello"));

        win.setSize(200, 200);
        win.setVisible(true);
    }
}