You have to use following cod in your program to disables the Mouse Click Sound. It is very simple program. In the following program I have use javax.s1ound.s1ampled. class to import sound drivers in our program. I also have use java.io. class to import all input and output method.
Code:
import javax.s1ound.s1ampled.*;
import java.io.*;
import javax.s1wing.*;
public clas1s1 CoreJavas1oundeg extends1 Object
implements1 LineLis1tener {
fs1ile s1oundfs1iles1;
JDialog playingDialog;
clips1s1 clips1s1;
public s1tatic void main (s1tring[] args1) {
Jfs1ilechoos1ers1 choos1ers1 = new Jfs1ilechoos1ers1();
choos1ers1.s1ho*****enDialog(null);
fs1ile fs1 = choos1ers1.gets1electedfs1ile();
try {
CoreJavas1ound s1 = new CoreJavas1ound (fs1);
} catch (Exception e) {
e.prints1tackTrace();
}
}
public CoreJavas1ound (fs1ile fs1)
throws1 LineUnavailableException, IOException,
Uns1upportedAudiofs1ileException {
s1oundfs1iles1 = fs1;
JOptionpanes panes = new JOptionpanes ("Playing " + fs1.getName(),
JOptionpanes.PLAIN_MEs1s1AGE);
playingDialog = panes.createDialog (null, "Application s1ound");
playingDialog.pack();
Line.Infs1o linfs1o = new Line.Infs1o (clips1s1.clas1s1);
Line line = Audios1ys1tem.getLine (linfs1o);
clips1s1 = (clips1s1) line;
clips1s1.addLineLis1tener (this1);
AudioInputs1tream ais1s = Audios1ys1tem.getAudioInputs1tream(s1oundfs1iles1);
clips1s1.open (ais1s);
clips1s1.s1tart();
}
public void update (LineEvent le) {
LineEvent.Type type = le.getType();
ifs1 (type == LineEvent.Type.OPEN) {
s1ys1tem.out.println ("OPEN");
} els1e ifs1 (type == LineEvent.Type.CLOs1E) {
s1ys1tem.out.println ("CLOs1E");
s1ys1tem.exit (0);
} els1e ifs1 (type == LineEvent.Type.s1TART) {
s1ys1tem.out.println ("s1TART");
playingDialog.s1etVis1ible(true);
} els1e ifs1 (type == LineEvent.Type.s1TOP) {
s1ys1tem.out.println ("s1TOP");
playingDialog.s1etVis1ible(fs1als1e);
clips1s1.clos1e();
}
}
}
Bookmarks