Hi again guys... I thought it'd be pretty stupid of me that whenever I would run into a problem I would make a new thread about it. Hence, this is the only thread I am ever going to post in regarding my own questions.
I would like to start off with a small question. I have the following:
private int getButtonIndex(Object o)
{
for(int i=0;i<b.length;i++)
{
if(b==o)
{
return i;
}
}
return -1;
} //Just wrote this to clarify, has nothing to do with my problem
public void actionPerformed(ActionEvent e)
{
int buttonIndex = getButtonIndex(e.getSource());
if(buttonIndex>-1 && buttonIndex<24)
{
this.s[buttonIndex].play();
guitarstring[0]=s[buttonIndex];
}
}
Now this code works perfectly. However, I want that whenever I play a sound (this.s[buttonIndex].play();) I want all other sounds that might be playing to stop playing. Is this possible? Thanks in advance!
/Teddy