1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| package ionoa.gui;
import ionoa.Main;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.JFrame;
@SuppressWarnings("serial")
public class GameFrame extends JFrame {
public GameFrame() {
this.setTitle("Catacombes");
this.setSize(1200, 900);
this.setResizable(false);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.add(new GamePanel(this));
this.setVisible(true);
try {
Clip clip = AudioSystem.getClip();
AudioInputStream inputStream = AudioSystem.getAudioInputStream(
Main.class.getResourceAsStream("res/a.wav"));
clip.open(inputStream);
clip.start();
} catch (Exception e) { System.out.println(e.getMessage()); }
}
} |
Partager