src/de/uapcore/sudoku/ActionHandler.java

changeset 7
2c0a2766461c
parent 6
5bab2e971333
--- a/src/de/uapcore/sudoku/ActionHandler.java	Sun Jan 27 15:03:57 2013 +0100
+++ b/src/de/uapcore/sudoku/ActionHandler.java	Thu Jan 31 18:44:44 2013 +0100
@@ -134,7 +134,10 @@
     }
     
     private void solve() {
-        // TODO: solve
+        if (!solver.check(field) || !solver.solve(field)) {
+            JOptionPane.showMessageDialog(field, "Das Feld ist nicht lösbar!",
+                    "Sudoku", JOptionPane.WARNING_MESSAGE);
+        }
     }
     
     private boolean saveUnsaved() {
@@ -162,6 +165,7 @@
         switch (e.getActionCommand()) {
         case NEW:
             if (saveUnsaved()) {
+                doc.clearFilename();
                 field.clear();
             }
             break;

mercurial