Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Silly question

 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I developed a mixture of a GUI a 2D application.Then I want deploy it into a html web page.
My question is how many ways for doing it?
Which way is the best?

Thanks
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two primary ways you could do it.

1) As an Applet
2) Using Java Web Start (JWS)

To deploy as an Applet, you would need to do some modification to your code so that it is an Applet, rather then an application. Using JWS, you can basically deploy your application as is.

The main difference is that an applet runs "inside" the web page. Just like all those wonderful advertisements on web pages today that use Flash, the applet appears within the web page. If the user closes the browser, or navigates away from the page, the Applet stops.

Using JWS, the application runs outside the web page (and outside the browser). In other words, it runs as if the user had it installed on their computer. And as mentioned above, if you go the Applet route, your program must extend either Applet or JApplet (which is a subclass of Applet).

The "tricky" part of both of these technologies is that you do not know what (if any) version of the JRE the user has installed on their computer. There are ways to set a minimum requirement in the deployment code. So if your Application needs Java version 1.5 or later, and the user has 1.4.2 installed, an installer is automatically launched to install the 1.5 version (assuming you set up your JWS JNLP page or your Applet's <object> tag correctly).

Take a look at the Sun's Java Web Start Documentation - there are developers guides and how to get started guides. There is also a JWS forum here at JavaRanch, as well as a forum on Applets.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic