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