Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.FlowLayout;

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

public class Main {
    public static void main(String args[]) {
        JFrame f = new JFrame("Label Demo");
        f.setLayout(new FlowLayout());
        f.setSize(300, 200);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JLabel label = new JLabel("java2s.com");
        f.add(label);
        f.setVisible(true);
    }
}