Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

complex applet

 
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. !
 
Sheriff
Posts: 21955
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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 ]
     
    Bartender
    Posts: 11445
    19
    Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Moving as this has more to do with applets.
     
    Saloon Keeper
    Posts: 22146
    151
    Android Eclipse IDE Tomcat Server Redhat Java 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.
     
    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,
     
    Squanch that. And squanch this tiny ad:
    Devious Experiments for a Truly Passive Greenhouse!
    https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
      Bookmark Topic Watch Topic
    • New Topic