I am creating a program for a personal project and I ended up creating many JButtons, which are taking up quite bit of lines in the project, is it possible to reduce the amount of lines that still produces that same amount of JButton?
JButton button1 = new JButton("Empty");
JButton button2 = new JButton("Empty");
JButton button3 = new JButton("Empty");
JButton button4 = new JButton("Empty");
JButton button5 = new JButton("Empty");
JButton button6 = new JButton("Empty");
JButton button7 = new JButton("Empty");
JButton button8 = new JButton("Empty");
JButton button9 = new JButton("Empty");
JButton button10 = new JButton("Empty");
JButton button11 = new JButton("Empty");
and about 5 more