Java Swing TitledBorder borderTitle(JComponent component, String title)

Here you can find the source of borderTitle(JComponent component, String title)

Description

border Title

License

Open Source License

Declaration

public static void borderTitle(JComponent component, String title) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 Stefan A. Tzeggai.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * //  w w w.j a  v  a  2s  .  co  m
 * Contributors:
 *     Stefan A. Tzeggai - initial API and implementation
 ******************************************************************************/

import javax.swing.BorderFactory;
import javax.swing.JComponent;

public class Main {
    public static void borderTitle(JComponent component, String title) {
        component.setBorder(BorderFactory.createTitledBorder(title));
    }
}

Related

  1. addMarginBorder(JPanel panel, String title, int top, int left, int bottom, int right)
  2. buildInfoPanelTextBorder(final JLabel content, final String title)
  3. buildInfoPanelTextBorderScroll(final JComponent content, final String title)
  4. buildLabeledBorder(String label)
  5. createBorder()