From 79a197d58f84fe49a2b8a5b9b960784dda4b4f31 Mon Sep 17 00:00:00 2001 From: fdai6499 Date: Wed, 11 Jan 2023 17:06:25 +0100 Subject: [PATCH] DTSUD-57 Implemented the save menu item in the menubar --- src/main/java/src/GameField.java | 4 ++-- src/main/java/src/MainFrame.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/src/GameField.java b/src/main/java/src/GameField.java index 0693441..342abff 100644 --- a/src/main/java/src/GameField.java +++ b/src/main/java/src/GameField.java @@ -41,13 +41,13 @@ public class GameField extends JPanel { int gapi = 0, gapj = 0; - for (int i = 0; i < nrOfFields; i++) { + for (int i = 0, addI = 1; i < nrOfFields; i++) { gameField[i] = new JPanel[nrOfFields]; labelField[i] = new JLabel[nrOfFields]; noteField[i] = new Notes[nrOfFields]; - for (int j = 0; j < nrOfFields; j++) { + for (int j = 0, addJ = 1; j < nrOfFields; j++) { gameField[i][j] = new JPanel(); gameField[i][j].setBorder(new LineBorder(Color.BLACK, 2)); diff --git a/src/main/java/src/MainFrame.java b/src/main/java/src/MainFrame.java index 69cdfd3..0b719e2 100644 --- a/src/main/java/src/MainFrame.java +++ b/src/main/java/src/MainFrame.java @@ -135,13 +135,16 @@ public class MainFrame extends JFrame { JMenu m_menu=new JMenu("Sudoku"); JMenu m_submenu=new JMenu("Neues Spiel"); + JMenuItem menu_i7=new JMenuItem("Speichern"); JMenuItem menu_i1=new JMenuItem("Nochmal"); JMenuItem menu_i2=new JMenuItem("Tipp"); JMenuItem menu_i4=new JMenuItem("Einfach"); JMenuItem menu_i5=new JMenuItem("Mittel"); JMenuItem menu_i6=new JMenuItem("Schwer"); + m_menu.add(menu_i1); m_menu.add(menu_i2); + m_menu.add(menu_i7); m_submenu.add(menu_i4); m_submenu.add(menu_i5); m_submenu.add(menu_i6);