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.border.LineBorder;
import javax.swing.border.TitledBorder;

public class Main {
    public static void main(String[] argv) {
        LineBorder border = new LineBorder(Color.red);
        TitledBorder titledBorder = BorderFactory.createTitledBorder(border, "Title");

        // Or: DEFAULT_JUSTIFICATION, LEFT, RIGHT
        titledBorder.setTitleJustification(TitledBorder.CENTER);
    }
}