JApplet and the browser


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: JApplet and the browser

  1. #1
    David Guest

    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

  2. #2
    Tom Duffy T Guest

    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



  3. #3
    David Guest

    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
    >



  4. #4
    Christian Yungk Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center