import javax.swing.*;
import java.awt.*;
public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame("Episode 6");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = frame.getContentPane();
JPanel panel = new JPanel();
GridLayout layout = new GridLayout(4, 5, 20, 20); //Creating a grid layout. last 2 params for gap sizes
//For grid layouts, if there is a number greater than 1 set for rows(first param), then the grid will ALWAYS have that amount of rows. The columns, on the other hand, can change.
//Now, if there is a 0 for rows, and a number for columns, there will always be that number of columns, and the rows will be added or unadded accordingly
panel.setLayout(layout);
for (int i = 0;i<10;i++){ //Generating buttons
panel.add(new JButton("Button"));
}
contentPane.add(panel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}