|
40 | 40 | import java.util.Locale; |
41 | 41 |
|
42 | 42 | import javax.swing.JApplet; |
43 | | -import javax.swing.JComponent; |
44 | 43 | import javax.swing.JRootPane; |
45 | 44 | import javax.swing.RepaintManager; |
46 | 45 |
|
@@ -480,35 +479,35 @@ public Locale getLocale() { |
480 | 479 | public String[][] getParameterInfo() { |
481 | 480 | return null; |
482 | 481 | } |
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 | | -// } |
496 | 482 |
|
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 | + } |
512 | 511 |
|
513 | 512 | /** |
514 | 513 | * Called by the browser or applet viewer to inform |
|
0 commit comments