|
-
Jan 8th, 2009, 09:56 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] applet problem
i've made a project, i want to test this code:
Code:
String cmdlocation = "c:\\program files\\Mozilla Firefox\\firefox.exe";
String gweb = cmdlocation
try {
Runtime.getRuntime().exec(gweb);
}
catch(IOException ioe){
System.out.println("Did not work");
}
and well, it works... but when i jar the file and add the jar to a html file, it doesnt work in the html file, but the jar file works opening with a batch file.
does anyone know how to fix that?
-
Jan 9th, 2009, 07:24 AM
#2
Re: applet problem
What do you mean "doesn't work in the html file"?
What does it do in the html file? Are you getting errors?
-
Jan 9th, 2009, 08:33 AM
#3
Thread Starter
Fanatic Member
Re: applet problem
well, i don't know if i have the rights to post it, so i wont post it, but if you want to try it should i pm you it?
i don't really know how to explain, but i will try...
i made a jar file out of my project and it worked perfectly, but when i added the jar file to my website, it didn't work. just like the buttons had no code in them...
-
Jan 9th, 2009, 08:56 AM
#4
Re: applet problem
Was this always run in an applet or did you run the code in an IDE (and it worked) and then put it in the applet and it didn't?
I'm not really sure, but I would imagine that an applet wouldn't have the permission, by default, to access and run programs on your local machine.
Check your java console to see if any errors are output.
-
Jan 9th, 2009, 11:02 AM
#5
Re: applet problem
Does your class extends java.applet.Applet or javax.swing.JApplet?
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jan 9th, 2009, 05:54 PM
#6
Thread Starter
Fanatic Member
Re: applet problem
import java.applet.Applet;
yes.
sorry for my late reply.
-
Jan 9th, 2009, 06:16 PM
#7
Re: applet problem
And you can see the applet in your html?
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jan 10th, 2009, 02:24 AM
#8
Thread Starter
Fanatic Member
Re: [RESOLVED] applet problem
thank you Computerjy for helping me.
it helped alot, but strange enough i got a error when it was _Blank but when it was _Top it worked.
-
Jan 10th, 2009, 03:48 AM
#9
Re: [RESOLVED] applet problem
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jan 10th, 2009, 04:20 AM
#10
Thread Starter
Fanatic Member
Re: [RESOLVED] applet problem
the code you pmed me, i pmed you that i got a error. and well, igot it working.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|