From c50acfece79031fcb92bb254fdbe02cbf2f27c44 Mon Sep 17 00:00:00 2001 From: TRC9696 Date: Mon, 30 Jan 2023 16:24:08 +0100 Subject: [PATCH] Added the first Button to the GUI --- src/main/java/game/StartTicTacToeGame.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/game/StartTicTacToeGame.java b/src/main/java/game/StartTicTacToeGame.java index 20e8d54..132de66 100644 --- a/src/main/java/game/StartTicTacToeGame.java +++ b/src/main/java/game/StartTicTacToeGame.java @@ -2,6 +2,8 @@ package game; import java.awt.Color; import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; @@ -10,7 +12,7 @@ import javax.swing.JLabel; import Gui.gui; -public class StartTicTacToeGame{ +public class StartTicTacToeGame implements ActionListener{ static JButton button = new JButton(); static JButton button2 = new JButton(); @@ -42,5 +44,18 @@ public class StartTicTacToeGame{ label.setFont(new Font("arial", Font.PLAIN, 30)); label.setBounds(320,20,500,50); gui.Frame.add(label); + + button = new JButton(); + button.setBackground(Color.white); + button.setBounds(200, 100, 100,100); + button.addActionListener(this); + gui.Frame.add(button); + } + + + @Override + public void actionPerformed(ActionEvent e) { + // TODO Auto-generated method stub + } } \ No newline at end of file