Here you can find the source of addSection(JPanel panel, String title)
public static void addSection(JPanel panel, String title)
//package com.java2s; //License from project: Open Source License import java.awt.Font; import javax.swing.JLabel; import javax.swing.JPanel; public class Main { public static void addSection(JPanel panel, String title) { addSection(panel, title, "center"); }//from w ww.j av a 2 s . co m public static void addSection(JPanel panel, String title, String alignment) { JLabel label = new JLabel(title); Font boldFont = label.getFont().deriveFont(Font.BOLD); label.setFont(boldFont); panel.add(label, "alignx " + alignment + ", wrap"); } }