Borders

// Create a border
EmptyBorder emptyBorder = (EmptyBorder)BorderFactory.createEmptyBorder();

LineBorder lineBorder = (LineBorder)BorderFactory.createLineBorder(Color.black);

EtchedBorder etchedBorder = (EtchedBorder)BorderFactory.createEtchedBorder();

BevelBorder raisedBevelBorder = (BevelBorder)BorderFactory.createRaisedBevelBorder();

BevelBorder loweredBevelBorder = (BevelBorder)BorderFactory.createLoweredBevelBorder();

ImageIcon icon = new ImageIcon("image.gif");
MatteBorder matteBorder = (MatteBorder)BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);


// Set the border
component.setBorder(emptyBorder);

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.