Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.BevelBorder;

public class Main extends JFrame {
    public Main(String name) {
        getContentPane().setLayout(new FlowLayout());
        JLabel labelTwo = new JLabel("www.java2s.com");
        labelTwo.setBorder(BorderFactory.createSoftBevelBorder(BevelBorder.RAISED, Color.red, Color.black));

        add(labelTwo);

    }

    public static void main(String[] args) {
        JFrame frame = new Main("javax.swing.JButton");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);

    }
}