JButton in JPanel with gridlayout
问题 Is it possible to bring it into this shape using the gridlayout? I use empty label to add this empty grid This is my code: import javax.swing.*; import java.awt.*; public class test { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setTitle("Buttons"); frame.setSize(800, 800); int size=12; int flag1=0,count=0,count2=0; frame.setLayout(new GridLayout(1,2,0,0)); JPanel panel = new JPanel(); GridLayout layout = new GridLayout(size,(size*2),0,0); panel.setLayout(layout