-
JApplet and the browser
There's something we have to add to the HTML before any browser can display
a JApplet right? What would that be? I've written an applet using swing components.
would there be any difference from the awt components? I hope not, but i'd
rather not convert to awt applet.
also, i read an earlier post on how to open a browser window from an application.
would it be possible to open another browser window (a new one not containing
the applet) from inside an applet, say after a click of a button? And it's
not just to load an existing page, i need it to load a page containing a
HTML file i would generate inside my applet. So my applet basically generates
an HTML page based on user data and displays it as a HTML page. please don't
tell me to just display it on the applet. i don't want that.
many thanks to those who could help
David
-
Re: JApplet and the browser
Hello David:
You'll need to provide Swing support for the applet as browsers don't. The
easiest way to do this is to jar up all of the Swing classes and reference
the jar in your archive parameter. This makes for very long downloads on
systems that don't have fast connections but it doesn't force every viewer
to install the JRE.
To show a URL in a new window, use showDocument(URL url, String target) and
set the target parameter to "_blank".
Hope this helps.
Tom Duffy
"David" <aberrant80@yahoo.com> wrote:
>
>There's something we have to add to the HTML before any browser can display
>a JApplet right? What would that be? I've written an applet using swing
components.
>would there be any difference from the awt components? I hope not, but i'd
>rather not convert to awt applet.
>
>also, i read an earlier post on how to open a browser window from an application.
>would it be possible to open another browser window (a new one not containing
>the applet) from inside an applet, say after a click of a button? And it's
>not just to load an existing page, i need it to load a page containing a
>HTML file i would generate inside my applet. So my applet basically generates
>an HTML page based on user data and displays it as a HTML page. please don't
>tell me to just display it on the applet. i don't want that.
>
>many thanks to those who could help
>David
-
Re: JApplet and the browser
Thanks a lot! and i was thinking if that could be done. u said to jar the
swing classes up, do u think it's possible to just jar the swing classes
that i use and use that? i'll try it later.
thanks again.
"Tom Duffy" T wrote:
>
>Hello David:
>
>You'll need to provide Swing support for the applet as browsers don't.
The
>easiest way to do this is to jar up all of the Swing classes and reference
>the jar in your archive parameter. This makes for very long downloads on
>systems that don't have fast connections but it doesn't force every viewer
>to install the JRE.
>
>To show a URL in a new window, use showDocument(URL url, String target)
and
>set the target parameter to "_blank".
>
>Hope this helps.
>
>Tom Duffy
>
-
Re: JApplet and the browser
David,
You can just jar up the classes you use. However keep in mind that any given
Swing class most likely references several others. You need to make sure
that you include all the relevant files. Generally I use the command line
compiler that comes with Visual Cafe to determine what classes my application
uses.
"David" <aberrant80@yahoo.com> wrote:
>
>Thanks a lot! and i was thinking if that could be done. u said to jar the
>swing classes up, do u think it's possible to just jar the swing classes
>that i use and use that? i'll try it later.
>thanks again.
>
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks