Here you can find the source of setLabelBorder(String label, JComponent c)
public static void setLabelBorder(String label, JComponent c)
//package com.java2s; /*/* ww w. j a v a 2 s . co m*/ * Copyright 2002 Stewart Allen <stewart@neuron.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the Artistic License. */ import java.awt.Color; import javax.swing.JComponent; import javax.swing.border.TitledBorder; import javax.swing.border.EtchedBorder; public class Main { private final static Color darkBlue = new Color(0, 0, 128); public static void setLabelBorder(String label, JComponent c) { TitledBorder b = new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), label); b.setTitleColor(darkBlue); c.setBorder(b); } }