set border on Jframe code example
Example 1: jframe border
YourFrame.getRootPane().setBorder(
BorderFactory.createMatteBorder(4, 4, 4, 4, Color.RED));
Example 2: how to create a border in a a jframe
.setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.RED));