diff --git a/src/gfn/marc/TicTacToe.java b/src/gfn/marc/TicTacToe.java index 2ea3492..e6bbf00 100644 --- a/src/gfn/marc/TicTacToe.java +++ b/src/gfn/marc/TicTacToe.java @@ -15,20 +15,20 @@ public class TicTacToe { // Laden der Spielstände Speicher.spielstaendeEinlesen(); - f = new Fenster(); - f.macheSichtbar(true); - // Spiel starten try { boolean nochEinSpiel = true; while (nochEinSpiel) { - f.newSpielfeld(); + f = null; + f = new Fenster(); nochEinSpiel = new Spiel(f).spielen(); // aufräumen + f.setVisible(false); Gewinner.setSpieler(null); Zug.setZugNummer(0); + } } catch (InterruptedException ie) { System.err.println("Da ist was schief gelaufen!"); diff --git a/src/gfn/marc/gui/Fenster.java b/src/gfn/marc/gui/Fenster.java index fdab4c9..4352ab6 100644 --- a/src/gfn/marc/gui/Fenster.java +++ b/src/gfn/marc/gui/Fenster.java @@ -3,7 +3,6 @@ package gfn.marc.gui; import gfn.marc.Feld; import gfn.marc.Speicher; import gfn.marc.Spielfeld; -import gfn.marc.Zug; import javax.swing.*; import java.awt.*; @@ -68,10 +67,9 @@ public class Fenster extends JFrame implements ActionListener { }); this.setLocationRelativeTo(null); this.setResizable(false); - - this.getContentPane().add(this.myPanel); this.spielfeld = new Spielfeld(this); + this.setVisible(true); } public void hinzufuegen(Component c) { @@ -87,14 +85,6 @@ public class Fenster extends JFrame implements ActionListener { } } - public void newSpielfeld() { - - } - - public void macheSichtbar(boolean sichtbar) { - this.setVisible(sichtbar); - } - public void setzeTitel(String titel) { this.setTitle(titel); }