I dont know how to stop the music here. Can anyone help me how to code.
private void mActionPerformed(java.awt.event.ActionEvent evt) {
JFXPanel j = new JFXPanel();
String uri = new File("src/Tiến_Quân_Ca.mp3").toURI() .toString();
if(m.isSelected()){
try{
new MediaPlayer(new Media(uri)).play();
}catch (Exception ex){
JOptionPane.showMessageDialog(null, ex);
}
}
}
I put this code on jtogglebutton, can you please show me how?