JButton disappear if I comment a bit of code

JButton disappear if I comment a bit of code

if I comment the code as shown the JButtons disappear

if I comment the code as shown the JButtons disappear

public class analisi_spesa {

public static void main(String[] args) {

JFrame mainFrame = new JFrame("Java SWING Examples");
mainFrame.setSize(400,400);
mainFrame.setLayout(new GridLayout(3, 1));

/* JLabel headerLabel = new JLabel("headerLabel",JLabel.CENTER ); JLabel statusLabel = new JLabel("statusLabel",JLabel.CENTER);
statusLabel.setSize(350,100); */ mainFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent windowEvent){ System.exit(0); }
});

JPanel controlPanel = new JPanel();
controlPanel.setLayout(new FlowLayout());

/* mainFrame.add(headerLabel); mainFrame.add(controlPanel); mainFrame.add(statusLabel); */

mainFrame.setVisible(true); 

// headerLabel.setText("Control in action: Button");

JButton okButton = new JButton("OK");
JButton submitButton = new JButton("Submit");
JButton cancelButton = new JButton("Cancel");

okButton.setActionCommand("OK");
submitButton.setActionCommand("Submit");
cancelButton.setActionCommand("Cancel");

okButton.addActionListener(new ButtonClickListener()); 
submitButton.addActionListener(new ButtonClickListener()); 
cancelButton.addActionListener(new ButtonClickListener()); 

controlPanel.add(okButton);
controlPanel.add(submitButton);
controlPanel.add(cancelButton);       

mainFrame.setVisible(true);

}

}

I wish they were shown as I don't comment the code. I took this example from https://www.tutorialspoint.com/swing/swing_event_handling.htm thank you all, I'm waiting for the answers.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

Fundamentos de Java: Aprende Java desde cero, sin misterios | Simpliv

Fundamentos de Java: Aprende Java desde cero, sin misterios