@Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof SongButton) { RoundController.guess((SongButton) e.getSource()); RoundController.stopRound(); if (Player.round < GameData.ROUNDS) { final Thread newRound = new Thread(this); newRound.setDaemon(true); newRound.start(); } } else throw new ClassCastException("Action event source is not the correct object (SongButton)"); }