Java Swing TitledBorder setLabelBorder(String label, JComponent c)

Here you can find the source of setLabelBorder(String label, JComponent c)

Description

set Label Border

License

Open Source License

Declaration

public static void setLabelBorder(String label, JComponent c) 

Method Source Code

//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);
    }
}

Related

  1. makeTitledBorder(String title)
  2. myBorder(String title)
  3. setBoldTitledBorder(String title, JComponent p)
  4. setBorder(Container panel, String title)
  5. setBorder(JComponent component, String text, int titleJustification)
  6. setPanelBorder(final JPanel p, final String s)
  7. setTitleBorder(JComponent pane, String title)
  8. titledBorder(String title, B comp)
  9. withTitledBorder(String title, JComponent c)