Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

complex applet

 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys : I was going to deploy a complex web app (includes a visualization tool, external communication with databases via JDBC/hibernate, multiple large linked eclipse projects, etc...) into an applet that can be run from a web page.

Is this possible ? I want a click and run, web embedded app, and the whole thing is done in swing so i figured it wouldnt be hard...

Please let me know. Im worried that after packaging it into an applet something will break or not work. !
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically it's possible. A JApplet has a lot of similarities with a JFrame, including the root pane and support for a JMenuBar.

There are some things you need to think about though:
  • A JApplet (and Applet) is not a top-level window. So any code you have for showing modal dialogs will have to be changed. You can use the code below for finding the Frame object in which the applet is located. This object actually represents the browser window; it's class will not be Frame.class or JFrame.class but some subclass of Frame.
  • You will have to sign the applet or it will only have access to the server it's downloaded from. Uses will then have to accept your certificate or it won't run.
  • Resizing the applet can only be done through JavaScript.
  • Stopping the application from being closed will not be possible for as far as I know.
  • Shutdown hooks are not guaranteed to run or complete.

  • There are some more limitations but I can't think of them right now.

    As for the code:
    This code is a bit more generic so you can call it for any type of component. In this case, you need to call it as

    [ November 04, 2008: Message edited by: Rob Prime ]
     
    Maneesh Godbole
    Saloon Keeper
    Posts: 11331
    16
    Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Moving as this has more to do with applets.
     
    Tim Holloway
    Saloon Keeper
    Posts: 18366
    56
    Android Eclipse IDE Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Also, 2-tier applets have to be signed, I believe. The standard applet sandbox rules don't permit JDBC.

    If it's a really complex app - something on the scale of ArgoUML, for example, it might be better to implement it as an application instead of an applet and use JNLP to download it. This is especially true if you intend to deploy outside a LAN (on the open Internet).

    Also, returning to the 2-tier theme, apps and applets on the open Internet can encounter filewall problems when using JDBC. And should. 2-tier apps are how the SQL Slammer worm managed to wreak so much havoc.
     
    takatoshi yanase
    Greenhorn
    Posts: 6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I have a demonstration system of 3-tier Java Applet on the Internet, which uses JDBC. It uses remote procedure calls by Spring Framework Remoting. It is slow initially because of download of jar files and compile.

    http://www.appletserver.com/kanjie/

    Thanks,
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic