Setting a Border

This example lists the various borders that are available.
component.setBorder(BorderFactory.createEmptyBorder()); component.setBorder(BorderFactory.createLineBorder(Color.black)); component.setBorder(BorderFactory.createEtchedBorder()); component.setBorder(BorderFactory.createRaisedBevelBorder()); component.setBorder(BorderFactory.createLoweredBevelBorder()); ImageIcon icon = new ImageIcon("image.gif"); component.setBorder(BorderFactory.createMatteBorder(-1, -1, -1, -1, icon));

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.