Load default web browser  
Author Message
smita bhopale via JavaKB.com





PostPosted: 2005-5-18 18:08:00 Top

java-programmer, Load default web browser 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<<All FILES>>)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
 
Roland





PostPosted: 2005-5-19 0:30:00 Top

java-programmer >> Load default web browser On 18-5-2005 12:07, smita bhopale via JavaKB.com wrote:

> 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<<All FILES>>)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_/ /__/
/ \ /_/ / \
 
smita bhopale via JavaKB.com





PostPosted: 2005-5-19 17:08:00 Top

java-programmer >> Load default web browser 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
 
 
smita bhopale via JavaKB.com





PostPosted: 2005-5-19 17:09:00 Top

java-programmer >> Load default web browser 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
 
 
Andrew Thompson





PostPosted: 2005-5-20 3:55:00 Top

java-programmer >> Load default web browser On Wed, 18 May 2005 10:07:54 GMT, smita bhopale via JavaKB.com wrote:

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

BrowserLauncher

>..[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