AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Load default web browser

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
smita bhopale via JavaKB.
Guest





PostPosted: Wed May 18, 2005 10:07 am    Post subject: Load default web browser Reply with quote



Hello,

I want to load a default web browser from my swing application [using
JApplet].

Using Runtime.getRuntime.exec("RunDLL 32.exe
shell32.dll,shellExec.RunDLL"+url);[for windows]
default browser can be called.But it is working in normal class & with
frames only.
with Applet or in swing-JApplet
it is showing error as :- java.security.AccessControlException:access
denied(java.io.FilePermission<)execute>.

I want a plateform independent solution which will work in swing-JApplet.

--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-jvm/200505/1
Back to top
Roland
Guest





PostPosted: Wed May 18, 2005 4:30 pm    Post subject: Re: Load default web browser Reply with quote



On 18-5-2005 12:07, smita bhopale via JavaKB.com wrote:

Quote:
Hello,

I want to load a default web browser from my swing application [using
JApplet].

Using Runtime.getRuntime.exec("RunDLL 32.exe
shell32.dll,shellExec.RunDLL"+url);[for windows]
default browser can be called.But it is working in normal class & with
frames only.
with Applet or in swing-JApplet
it is showing error as :- java.security.AccessControlException:access
denied(java.io.FilePermission<)execute>.

I want a plateform independent solution which will work in swing-JApplet.

Do you want to open a new browser window from within your applet? In

that case, use something like the following in your Applet (or JApplet):

URL url = new URL("http://java.sun.com/");
String targetWindow = "ArbitraryNameToIdentifyNewWindow";
AppletContext ctx = this.getAppletContext();
ctx.showDocument(url, targetWindow);


See:
<http://java.sun.com/j2se/1.4.2/docs/api/java/applet/Applet.html#getAppletContext()>
<http://java.sun.com/j2se/1.4.2/docs/api/java/applet/AppletContext.html#showDocument(java.net.URL,%20java.lang.String)>
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ /_/ /

Back to top
smita bhopale via JavaKB.
Guest





PostPosted: Thu May 19, 2005 9:08 am    Post subject: Re: Load default web browser Reply with quote



If I am using browser to open my html file in which I have included the
<applet code=classfilename></applet>
then only showDocument will work.

If I try using appletviewer then it is not working.

I have just tried using following command-
Runtime.getRuntime().exec("cmd /c start "+url_in_string) ;
but I have to change the java.policy file & add permission like -
permission java.security.AllPermission;
It is working in Japplet or Applet & using appletviewer also.

But I want plateform independent code .What can I do ?

I find WebBrowser.html from au.com.zip.cs package from google.
But I don't know wheather it will support the scripts,sound,flash or video
files .I have not found How to download the whole package & how to use it.

Is there any different solution for this problem?

--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-jvm/200505/1
Back to top
smita bhopale via JavaKB.
Guest





PostPosted: Thu May 19, 2005 9:09 am    Post subject: Re: Load default web browser Reply with quote

If I am using browser to open my html file in which I have included the
<applet code=classfilename></applet>
then only showDocument will work.

If I try using appletviewer then it is not working.

I have just tried using following command-
Runtime.getRuntime().exec("cmd /c start "+url_in_string) ;
but I have to change the java.policy file & add permission like -
permission java.security.AllPermission;
It is working in Japplet or Applet & using appletviewer also.

But I want plateform independent code .What can I do ?

I find WebBrowser class from au.com.zip.cs package from google.
But I don't know wheather it will support the scripts,sound,flash or video
files .I have not found How to download the whole package & how to use it.

Is there any different solution for this problem?

--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-jvm/200505/1
Back to top
Andrew Thompson
Guest





PostPosted: Thu May 19, 2005 7:54 pm    Post subject: Re: Load default web browser Reply with quote

On Wed, 18 May 2005 10:07:54 GMT, smita bhopale via JavaKB.com wrote:

Quote:
I want to load a default web browser from my swing application

BrowserLauncher

Quote:
..[using JApplet].

An applet is not generally referred to as an application,
which in Java terms, would be a Frame/JFrame or non-GUI'd app.

For an applet(/JApplet), you can use showDocument() as suggested by Roland.

Only a signed applet could use BrowserLauncher, but using
showDocument makes more sense for an applet in any case.

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.