Java Swing LineBorder getDefaultLineBorder()

Here you can find the source of getDefaultLineBorder()

Description

get Default Line Border

License

Open Source License

Declaration

public static Border getDefaultLineBorder() 

Method Source Code


//package com.java2s;
/*// w  ww  . ja v  a 2 s. c  o m
 * UIUtils.java
 *
 * Copyright (C) 2002-2015 Takis Diakoumis
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */

import java.awt.Color;

import javax.swing.BorderFactory;

import javax.swing.UIManager;
import javax.swing.border.Border;

public class Main {
    public static Border getDefaultLineBorder() {

        return BorderFactory.createLineBorder(getDefaultBorderColour());
    }

    /**
     * Convenience method for consistent border colour.
     *
     * @return the system default border colour
     */
    public static Color getDefaultBorderColour() {

        return getColour("executequery.Border.colour", "controlDkShadow");
    }

    public static Color getColour(String key, String defaultKey) {

        Color color = UIManager.getColor(key);
        if (color != null) {

            return color;

        } else {

            return UIManager.getColor(defaultKey);
        }

    }

    public static Color getColour(String key, Color defaultColour) {

        Color color = UIManager.getColor(key);
        if (color != null) {

            return color;

        } else {

            return defaultColour;
        }

    }
}

Related

  1. createLineBorder()
  2. createPanelBorder()
  3. createThickInsetBorder()
  4. drawBorders(final JPanel panel)
  5. getBorderBlue()
  6. getLineBorder()
  7. getMandatoryBorder()
  8. getToolTipBorder()
  9. intToBorder(int borderConstant)