Creating and Setting a Lowered BevelBorder from BorderFactory : Custom Border « Swing « Java Tutorial






import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.border.BevelBorder;

public class Main {
  public static void main(String[] argv) {
    BevelBorder loweredBevelBorder = (BevelBorder)BorderFactory.createLoweredBevelBorder();
    JLabel component = new JLabel("label");
    component.setBorder(loweredBevelBorder);

  }
}








14.108.Custom Border
14.108.1.Creating Your Own Borders
14.108.2.implements Border interfaceimplements Border interface
14.108.3.Subclass AbstractBorderSubclass AbstractBorder
14.108.4.Creating a Compound Border
14.108.5.Creating and Setting a Raised BevelBorder from BorderFactory
14.108.6.Creating and Setting a Lowered BevelBorder from BorderFactory