add border panel code example Example: how to create a border in a a jframe .setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.RED));