Java Swing Border makeTitledBorder(JComponent panel, String title, Color color)

Here you can find the source of makeTitledBorder(JComponent panel, String title, Color color)

Description

make Titled Border

License

Apache License

Declaration

public static TitledBorder makeTitledBorder(JComponent panel, String title, Color color) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import javax.swing.*;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;

import java.awt.*;

public class Main {
    public static TitledBorder makeTitledBorder(JComponent panel, String title, Color color) {
        TitledBorder result = BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), title, TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, null, color);
        panel.setBorder(result);// w w w.jav a  2  s  .  c om
        return result;
    }
}

Related

  1. getToolTipBorder()
  2. getWebBorderShape(final JComponent component, final int shadeWidth, final int round)
  3. initLineBorderPanel(Color color, Color lineColor)
  4. installBorder(JComponent c, Border defaultBorder)
  5. isStandardBorder(Border b)
  6. paintBorderDebugInfo(final Graphics g, final JComponent c)
  7. removePopupBorder(final Container c)
  8. repaintBorder(JComponent component)
  9. repaintBorder(JComponent component)