public Frame(String title) {
setTitle(title);
try{
Clip crit = AudioSystem.getClip();
AudioInputStream inputStream1 = AudioSystem.getAudioInputStream(this.getClass().getResource("k.wav"));
crit.open(inputStream1);
crit.loop(Clip.LOOP_CONTINUOUSLY);
} catch(Exception e){
e.printStackTrace();
}
setContentPane(new JLabel(new ImageIcon(Frame.class.getClassLoader().getResource("img/lel.png"))));
setVisible(true);
setBounds(600,600,1024,833);
this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
this.setResizable(false);
setLocationRelativeTo(null);
addMouseListener(this);
}
I'm trying to figure out how to add the lel.png and k.wav to be inside of the JAR file to make my program work?