Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.border.Border;

public class Main {
    public static void main(String args[]) {
        JFrame frame = new JFrame("Fourth Button");
        Container contentPane = frame.getContentPane();
        JButton b = new JButton("Button!");
        Border bored = BorderFactory.createLineBorder(Color.RED);
        b.setBorder(bored);
        contentPane.add(b, BorderLayout.CENTER);
        frame.setSize(350, 200);
        frame.show();
    }
}