home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-03-13 | 690 b | 35 lines |
- import java.awt.*;
- import java.applet.*;
- import java.net.*;
-
- public class SoundApplet extends Applet
- {
- Button button;
-
- public void init()
- {
- BorderLayout layout = new BorderLayout();
- setLayout(layout);
-
- Font font = new Font("TimesRoman", Font.BOLD, 32);
- setFont(font);
-
- button = new Button("Play Sound");
- add("Center", button);
-
- resize(250, 250);
- }
-
- public boolean action(Event evt, Object arg)
- {
- if (evt.target instanceof Button)
- {
- URL codeBase = getCodeBase();
- play(codeBase, "spacemusic.au");
- }
-
- return true;
- }
- }
-
-