import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class SimpleExample extends JFrame {
public SimpleExample() {
As a good practice, you should not add the button directly to the JFrame. Instead, add a JPanel to the frame, set the panel's layout to null, and add the JButton to the JPanel.