public class TestGUI
extends JFrame
{
public TestGUI()
throws Exception
{
JButton b = new JButton("Test");
Border bo1 = BorderFactory.createMatteBorder(2, 0, 0, 0, Color.GREEN);
Border bo2 = BorderFactory.createMatteBorder(0, 3, 0, 0, Color.RED);
b.setBorder(BorderFactory.createCompoundBorder(bo1, bo2));
JPanel p = new JPanel();
p.add(b);
add(p);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(100, 100);
setVisible(true);
}
public static void main(String[] args)
throws Exception
{
new TestGUI();
}
}