This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes reg audioclip Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reg audioclip" Watch "reg audioclip" New topic
Author

reg audioclip

Prabhu Raghunathan
Greenhorn

Joined: Oct 23, 2000
Posts: 8
public void sayIt(Applet app){
String english = num.toEnglish();
StringTokenizer ST = new StringTokenizer(english);
do {
String token = ST.nextToken();

String audio = "http://www.cs.wustl.edu/~sck/504/current-semester/lab/lab4/audio/";
(app.getAudioClip(newURL(audio+token+".au"))).play();
}
while(ST.hasMoreTokens());
}
private URL newURL(String str)
{
URL url = null;
try {
url = new URL(str);
System.out.println("tok");
}
catch(MalformedURLException murle)
{
System.exit(0);
}
return url;
}
Hi all,
On implementing this piece of code it compiles fine.But I get a runtime error saying sun.applet.AppletSecurityException:checkconnect.networkhost1.I dont understand why this happens.Thanks.
Prabhu.R

prabs..
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Applet security, an Applet can only establish a connect back to the server that initiated it. This prevents a rogue applet from performing operations on a computer which could be dangerous or comprimise the computers security.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reg audioclip
 
Similar Threads
Stacks
next line in swings
String replace for URLs
Facing Problem with String replaceAll method
StringTokenizer and the "" empty string