Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Main {
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        JPanel panel = new JPanel(new GridLayout(10, 10, 10, 10));

        for (int i = 0; i < 100; i++) {
            panel.add(new JButton(String.valueOf(i)));
        }

        frame.add(panel);

        frame.setSize(600, 600);
        frame.setVisible(true);
    }
}