Skip to content

Commit a908731

Browse files
hansonrhansonr
authored andcommitted
adds Applet.play
1 parent deb4131 commit a908731

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

sources/net.sf.j2s.java.core/src/java/applet/JSApplet.java

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import java.util.Locale;
4141

4242
import javax.swing.JApplet;
43-
import javax.swing.JComponent;
4443
import javax.swing.JRootPane;
4544
import javax.swing.RepaintManager;
4645

@@ -480,35 +479,35 @@ public Locale getLocale() {
480479
public String[][] getParameterInfo() {
481480
return null;
482481
}
483-
//
484-
// /**
485-
// * Plays the audio clip at the specified absolute URL. Nothing
486-
// * happens if the audio clip cannot be found.
487-
// *
488-
// * @param url an absolute URL giving the location of the audio clip.
489-
// */
490-
// public void play(URL url) {
491-
// AudioClip clip = getAudioClip(url);
492-
// if (clip != null) {
493-
// clip.play();
494-
// }
495-
// }
496482

497-
// /**
498-
// * Plays the audio clip given the URL and a specifier that is
499-
// * relative to it. Nothing happens if the audio clip cannot be found.
500-
// *
501-
// * @param url an absolute URL giving the base location of the
502-
// * audio clip.
503-
// * @param name the location of the audio clip, relative to the
504-
// * <code>url</code> argument.
505-
// */
506-
// public void play(URL url, String name) {
507-
// AudioClip clip = getAudioClip(url, name);
508-
// if (clip != null) {
509-
// clip.play();
510-
// }
511-
// }
483+
/**
484+
* Plays the audio clip at the specified absolute URL. Nothing
485+
* happens if the audio clip cannot be found.
486+
*
487+
* @param url an absolute URL giving the location of the audio clip.
488+
*/
489+
public void play(URL url) {
490+
AudioClip clip = getAudioClip(url);
491+
if (clip != null) {
492+
clip.play();
493+
}
494+
}
495+
496+
/**
497+
* Plays the audio clip given the URL and a specifier that is
498+
* relative to it. Nothing happens if the audio clip cannot be found.
499+
*
500+
* @param url an absolute URL giving the base location of the
501+
* audio clip.
502+
* @param name the location of the audio clip, relative to the
503+
* <code>url</code> argument.
504+
*/
505+
public void play(URL url, String name) {
506+
AudioClip clip = getAudioClip(url, name);
507+
if (clip != null) {
508+
clip.play();
509+
}
510+
}
512511

513512
/**
514513
* Called by the browser or applet viewer to inform

0 commit comments

Comments
 (0)