Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;

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("Compound Borders");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JButton bevelLineButton = new JButton("Bevel Line");
        Border redBorder = BorderFactory.createLineBorder(Color.MAGENTA, 2, true);
        bevelLineButton.setBorder(redBorder);

        Container contentPane = frame.getContentPane();
        contentPane.setLayout(new GridLayout(1, 2));
        contentPane.add(bevelLineButton);
        frame.setSize(300, 100);
        frame.setVisible(true);
    }
}