mirror of
				https://github.com/lov3b/Schack.git
				synced 2025-11-03 22:50:24 +01:00 
			
		
		
		
	Bort med logger + fallthrough
This commit is contained in:
		@@ -122,20 +122,15 @@ public class Board extends JPanel implements MouseListener {
 | 
			
		||||
                    JOptionPane.showMessageDialog(this, "Du står i schack");
 | 
			
		||||
                    break;
 | 
			
		||||
                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:
 | 
			
		||||
                    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 {
 | 
			
		||||
                            restartGame();
 | 
			
		||||
                        } catch (IOException ex) {
 | 
			
		||||
                            Logger.getLogger(Board.class.getName()).log(Level.SEVERE, null, ex);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    break;
 | 
			
		||||
 
 | 
			
		||||
@@ -76,7 +76,6 @@ public class Schack {
 | 
			
		||||
                    try {
 | 
			
		||||
                        board.restartGame();
 | 
			
		||||
                    } catch (IOException ex) {
 | 
			
		||||
                        Logger.getLogger(Schack.class.getName()).log(Level.SEVERE, null, ex);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -88,7 +87,6 @@ public class Schack {
 | 
			
		||||
                try {
 | 
			
		||||
                    board.restartGame();
 | 
			
		||||
                } catch (IOException ex) {
 | 
			
		||||
                    Logger.getLogger(Schack.class.getName()).log(Level.SEVERE, null, ex);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user