i am done with almost all the functions of a simple mp3 player , i am trying to make , i 'm stuck with pause function, i dont know , i was thinking of creating a separate thread for it...
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
song_name=(String) jTable2.getValueAt(jTable2.getSelectedRow(), 0);
if(count>0)
{
clip.stop();
clip= getAudioClip(getCodeBase(), "songs/" + song_name+".MP3");
clip.play();
}
else
{
clip=getAudioClip(getCodeBase(),"songs/"+song_name+".MP3");
clip.play();
}
count++;
jLabel3.setText("chanegd");
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
clip.stop();
int x=jTable2.getSelectedRow();
x++;
jTable2.changeSelection(x,0,false,true);
song_name=(String)jTable2.getValueAt(x,0);
clip=getAudioClip(getCodeBase(),"songs/"+song_name+".MP3");
clip.play();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
clip.stop(); // TODO add your handling code here:
}
private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {
}
private void jTable2MouseClicked(java.awt.event.MouseEvent evt) {
jLabel3.setText(jTable2.getValueAt(jTable2.getSelectedRow(), 0) + "");
jTable2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// TODO add your handling code here:
}