JButton myButton = new JButton("Click me!"); myButton.setBorderPainted(false);
JButton myButton = new JButton("Submit"); myButton.setBorderPainted(true);In this example, we create another JButton object and set its text to "Submit". We then call the setBorderPainted method and pass in true as the argument, which means that the button's border will be drawn. Both of these examples use the java.awt package library, which provides classes for creating graphical user interfaces (GUIs) in Java.