Posted on 2001-06-18
I want to use the sun.audio.* classes in my applet.
However, I do not want to use: import sun.audio.*;, because not all browsers have the sun.audio.*-classes. Rather I want to use:
audioStream = Class.forName(sun.audio.AudioStream);
audioPlayer = Class.forName(sun.audio.AudioPlayer);
However, when I do this, I can obviously not declare a public variable: public AudioPlayer audioPlayer;, because the package has not yet been imported.
Any suggestions for how to deal with this?