I have a problem with jLayer. I have a button with code for starting a song:
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try {
Player prehravac;
FileInputStream buff = new FileInputStream(Okno.filename);
prehravac = new Player(buff);
prehravac.play();
if (prehravac != null) {
prehravac.close();
this.dispose();
}
} catch(Exception e) {
}
}
When I click on this button, it begins to play the song but whole application freezes and I cannot click on anything. When the song ends, it's okay and I can click on other components again.
Can someone help me pls ? :) thank