From f716d8797b7a6ba177060d98a524a20045270001 Mon Sep 17 00:00:00 2001 From: fdai6499 Date: Tue, 3 Jan 2023 18:35:35 +0100 Subject: [PATCH] added buttons --- sudokuExample/src/Main2.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sudokuExample/src/Main2.java b/sudokuExample/src/Main2.java index 266c4d4..346d247 100644 --- a/sudokuExample/src/Main2.java +++ b/sudokuExample/src/Main2.java @@ -1,10 +1,13 @@ import javax.swing.*; import javax.swing.border.EmptyBorder; +import java.awt.*; public class Main2 { public static void main(String[] args) { + java.awt.EventQueue.invokeLater(new Runnable() { + @Override public void run() { @@ -16,6 +19,15 @@ public class Main2 { yPanel.setLayout(new BoxLayout(yPanel, BoxLayout.Y_AXIS)); yPanel.setBorder(new EmptyBorder(1, 0, 1,0)); + JButton jButton1 = new JButton(); + jButton1.setText("Test Button 1"); + + yPanel.add(jButton1); + + JButton jButton2 = new JButton(); + jButton2.setText("Test Button 2"); + yPanel.add(jButton2); + for (int i = 0; i < 9; i++) { JPanel xPanel = new JPanel();