Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a java applet for today's browsers (applet, embed, object)?

How do i deploy a java applet for modern browsers? I know there are somehow 3 possibilities but nobody tells me which one to prefer and how to use them.

Does somebody have any resources on that? i cant find any :(

like image 952
Michael Siebert Avatar asked Jun 12 '09 09:06

Michael Siebert


People also ask

How do you deploy a Java applet?

Java applets can be launched in two ways. You can launch your applet by using Java Network Launch Protocol (JNLP). Applets launched by using JNLP have access to powerful JNLP APIs and extensions. Alternatively, you can launch an applet by specifying the applet's launch properties directly in the applet tag.

How a Java applet is executed in the browser?

Applets are executed inside the browser via the so-called "Java Plug-in", which is a JRE capable of running Java applets in a secure manner (just like most web browsers have plug-ins for running flash, JavaScript, VBScript and other programs).

How is a Java applet embedded into a web page explain?

An applet is a Java program that can be embedded into a web page. It runs inside the web browser and works at client side. An applet is embedded in an HTML page using the APPLET or OBJECT tag and hosted on a web server. Applets are used to make the website more dynamic and entertaining.

Can a Java applet be executed from a Web browser?

A Java applet can be executed from a Web browser. The class name must be the same as the file name that contains the class. A file may contain several classes. Each class in the file is compiled into a separate bytecode file.


1 Answers

If you can target Java 6 update 10 or better, you can simplify your life:

<script src="http://java.com/js/deployJava.js"></script> <script>     var attributes = {codebase:'http://java.sun.com/products/plugin/1.5.0/demos/jfc/Java2D',                       code:'java2d.Java2DemoApplet.class',                       archive:'Java2Demo.jar',                       width:710, height:540} ;     var parameters = {fontSize:16} ;     var version = '1.6' ;     deployJava.runApplet(attributes, parameters, version); </script> 
like image 172
Robert Munteanu Avatar answered Sep 25 '22 01:09

Robert Munteanu