Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.border.Border;

public class Main {
    public static void main(String[] args) {

        JLabel label = new JLabel("java2s.com", JLabel.LEFT);
        Border border = BorderFactory.createLineBorder(Color.BLACK);
        label.setBorder(border);

        JOptionPane.showMessageDialog(null, label);

    }
}