> Hello,
>
[quoted text clipped - 10 lines]
>
> 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#showDocum
ent(java.net.URL,%20java.lang.String)>

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
smita bhopale - 19 May 2005 10:08 GMT
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?
smita bhopale - 19 May 2005 10:08 GMT
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?
> 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

Signature
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