commit d1e1cb6ac54abdeb92ed39add9caeb5b29955b9b
parent c5330a81a91b049169727290776426f9bf05311f
Author: adglas21 <adamglasheen99@gmail.com>
Date: Tue, 12 Nov 2024 10:20:29 +0000
Create game button action listener
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java b/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java
@@ -5,6 +5,8 @@
package com.groupproject.tictactoeclient.ContentPanes;
import com.groupproject.tictactoeclient.TicTacToeClient;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
@@ -86,5 +88,19 @@ public class MainContentPanel extends JPanel {
// View score button constraints
layout.putConstraint(SpringLayout.SOUTH, viewScoreButton, -20, SpringLayout.SOUTH, this);
layout.putConstraint(SpringLayout.EAST, viewScoreButton, -20, SpringLayout.EAST, this);
+
+
+
+
+
+ //Create game button action listener
+ createGameButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ client.proxy.newGame(Integer.parseInt(client.UID));
+ }
+ });
+
+
}
}
\ No newline at end of file