From cfdbc6046185d372f4c7060c737fd34cecce1d1a Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:09:03 +0100 Subject: [PATCH 1/7] Setup Panel with label nr 3 --- src/main/java/src/MainFrame.java | 37 +++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index 405ff81..973ad23 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -5,9 +5,13 @@ import javax.swing.border.LineBorder; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; public class MainFrame extends JFrame { + private GameField gameField; + public void run() { this.setLayout(null); @@ -28,7 +32,7 @@ public class MainFrame extends JFrame { header.setBounds(125, 5, 250, 50); rootPanel.add(header); - GameField gameField = new GameField(360); + gameField = new GameField(360); gameField.setBounds(70, 50, 360, 360); rootPanel.add(gameField); @@ -42,9 +46,14 @@ public class MainFrame extends JFrame { JPanel jPanel1 = setupNums("1"); boxPanel.add(jPanel1); + JPanel jPanel2 = setupNums("2"); boxPanel.add(jPanel2); + JPanel jPanel3 = setupNums("3"); + boxPanel.add(jPanel3); + + JButton back = new JButton(); back.setVisible(true); back.setBounds(5, 5, 100, 25); @@ -76,7 +85,33 @@ public class MainFrame extends JFrame { jPanel.setBackground(Color.BLUE); jPanel.setVisible(true); jPanel.setBorder(new LineBorder(Color.PINK, 1)); + jPanel.addMouseListener(new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + + } + + @Override + public void mousePressed(MouseEvent e) { + gameField.getActivePanel().setValue(Integer.valueOf(number)); + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } + }); JLabel numLabel1 = new JLabel(); numLabel1.setText(number); numLabel1.setLayout(null); From af60eb4e047550cf2104d466acdc520108439f41 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:11:06 +0100 Subject: [PATCH 2/7] Setup Panel with label nr 4 --- src/main/java/src/MainFrame.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index 973ad23..03ebd34 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -46,13 +46,15 @@ public class MainFrame extends JFrame { JPanel jPanel1 = setupNums("1"); boxPanel.add(jPanel1); - JPanel jPanel2 = setupNums("2"); boxPanel.add(jPanel2); JPanel jPanel3 = setupNums("3"); boxPanel.add(jPanel3); + JPanel jPanel4 = setupNums("4"); + boxPanel.add(jPanel4); + JButton back = new JButton(); back.setVisible(true); From fdfa4f9c20ddbf6c1f3fd5d19fda72c8c68bc200 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:12:41 +0100 Subject: [PATCH 3/7] Setup Panel with label nr 5 --- src/main/java/src/MainFrame.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index 03ebd34..46b9ee2 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -55,6 +55,9 @@ public class MainFrame extends JFrame { JPanel jPanel4 = setupNums("4"); boxPanel.add(jPanel4); + JPanel jPanel5 = setupNums("5"); + boxPanel.add(jPanel5); + JButton back = new JButton(); back.setVisible(true); From 3ff654ca1794c4f59d87b36d6328305e453107c1 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:13:52 +0100 Subject: [PATCH 4/7] Setup Panel with label nr 6 --- src/main/java/src/MainFrame.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index 46b9ee2..c8fa248 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -58,6 +58,8 @@ public class MainFrame extends JFrame { JPanel jPanel5 = setupNums("5"); boxPanel.add(jPanel5); + JPanel jPanel6 = setupNums("6"); + boxPanel.add(jPanel6); JButton back = new JButton(); back.setVisible(true); From 912c58a68d87b31df9f97ec74bc5017844730353 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:15:15 +0100 Subject: [PATCH 5/7] Setup Panel with label nr 7 --- src/main/java/src/MainFrame.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index c8fa248..1fdf681 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -61,6 +61,9 @@ public class MainFrame extends JFrame { JPanel jPanel6 = setupNums("6"); boxPanel.add(jPanel6); + JPanel jPanel7 = setupNums("7"); + boxPanel.add(jPanel7); + JButton back = new JButton(); back.setVisible(true); back.setBounds(5, 5, 100, 25); From 92ced1d54dfb8f4fe04d308c54aaab3566bd99f4 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:18:13 +0100 Subject: [PATCH 6/7] Setup Panel with label nr 8 --- src/main/java/src/MainFrame.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index 1fdf681..cbd59b9 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -64,6 +64,9 @@ public class MainFrame extends JFrame { JPanel jPanel7 = setupNums("7"); boxPanel.add(jPanel7); + JPanel jPanel8 = setupNums("8"); + boxPanel.add(jPanel8); + JButton back = new JButton(); back.setVisible(true); back.setBounds(5, 5, 100, 25); From f290fdaa763021f1b49a6b336686c255df06a2b3 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Sat, 21 Jan 2023 12:20:15 +0100 Subject: [PATCH 7/7] Setup Panel with label nr 9 --- src/main/java/src/MainFrame.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index cbd59b9..0071c01 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -67,6 +67,9 @@ public class MainFrame extends JFrame { JPanel jPanel8 = setupNums("8"); boxPanel.add(jPanel8); + JPanel jPanel9 = setupNums("9"); + boxPanel.add(jPanel9); + JButton back = new JButton(); back.setVisible(true); back.setBounds(5, 5, 100, 25);