added error handling to remote resource in Display
This commit is contained in:
parent
2f8c4b7168
commit
72387080e1
@ -10,7 +10,8 @@ import java.util.List;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.Clip;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.*;
|
||||
|
||||
|
||||
public class Display extends JPanel{
|
||||
private List<Drawer> visuals;
|
||||
@ -40,12 +41,16 @@ public class Display extends JPanel{
|
||||
clip.loop(Clip.LOOP_CONTINUOUSLY);
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace(System.out);
|
||||
JOptionPane.showMessageDialog(null, "Sajnos nem sikerült letölteni a cicazenét! :(");
|
||||
}
|
||||
}
|
||||
|
||||
public void stopMusic() {
|
||||
clip.stop();
|
||||
try {
|
||||
clip.stop();
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
{}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user