mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 12:50:10 +01:00
Bort med logger + fallthrough
This commit is contained in:
parent
d8bdacdb80
commit
0d80b0e37c
@ -122,20 +122,15 @@ public class Board extends JPanel implements MouseListener {
|
|||||||
JOptionPane.showMessageDialog(this, "Du står i schack");
|
JOptionPane.showMessageDialog(this, "Du står i schack");
|
||||||
break;
|
break;
|
||||||
case SCHACKMATT:
|
case SCHACKMATT:
|
||||||
if (JOptionPane.showConfirmDialog(this, "Schackmatt\nVill du starta om?") == JOptionPane.YES_OPTION) {
|
|
||||||
try {
|
|
||||||
restartGame();
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Logger.getLogger(Board.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PATT:
|
case PATT:
|
||||||
if (JOptionPane.showConfirmDialog(this, "Patt\nVill du starta om?") == JOptionPane.YES_OPTION) {
|
String stateStr = state.toString();
|
||||||
|
String msg = stateStr.charAt(0) + stateStr.substring(1, stateStr.length()).toLowerCase();
|
||||||
|
int choice = JOptionPane.showConfirmDialog(this, msg + "\nVill du starta om?");
|
||||||
|
|
||||||
|
if (choice == JOptionPane.YES_OPTION) {
|
||||||
try {
|
try {
|
||||||
restartGame();
|
restartGame();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(Board.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -76,7 +76,6 @@ public class Schack {
|
|||||||
try {
|
try {
|
||||||
board.restartGame();
|
board.restartGame();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(Schack.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,7 +87,6 @@ public class Schack {
|
|||||||
try {
|
try {
|
||||||
board.restartGame();
|
board.restartGame();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(Schack.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user