Java Swing LineBorder setBorder(JComponent comp)

Here you can find the source of setBorder(JComponent comp)

Description

set Border

License

Apache License

Declaration

public static void setBorder(JComponent comp) 

Method Source Code

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

import java.awt.Color;

import javax.swing.BorderFactory;

import javax.swing.JComponent;

import javax.swing.border.Border;

import javax.swing.border.LineBorder;

public class Main {
    public static final int RAISED_BORDER = 0;
    public static final int LOWERED_BORDER = 1;
    public static final int LINE_BORDER = 2;

    public static void setBorder(JComponent comp) {
        setBorder(comp, RAISED_BORDER);/*from  w  w  w .  j  av a  2 s . c  o  m*/
    }

    public static void setBorder(JComponent comp, int borderType) {
        Border border = BorderFactory.createRaisedBevelBorder();
        if (borderType == LOWERED_BORDER)
            border = BorderFactory.createLoweredBevelBorder();
        else if (borderType == LINE_BORDER)
            border = new LineBorder(Color.BLACK);
        comp.setBorder(border);
    }
}

Related

  1. getToolTipBorder()
  2. intToBorder(int borderConstant)
  3. isAtScrollPaneRightBorder(Component c, int x)
  4. lineBorder(JComponent comp)
  5. recursiveAddBorderToPanel(JComponent c)
  6. setBorder(JComponent comp, boolean setBorder)
  7. setBorder(JComponent component, int width)
  8. setLineBorder(JComponent... components)
  9. showBorder(JComponent c)