Web Design With Java: What Is A Java Applet And How Do You Create One?
Learn more about what Java is and how (and why) you'd create and use an applet computer code in your web page designs.
Java is a programming language, developed by Sun Microsystems, which is now widely used. The benefit of Java is that a developer can write something in Java and it can run on any operating system (Windows, Linux, and UNIX). Java accomplishes this by splitting the language up between the code and the JVM (Java Virtual Machine). The JVM is specific to the operating system (OS) and translates the code into something that runs on that OS.
Developers can use Java to create entire applications, server based programs or applets. Java applets are small Java programs which can be embedded in a web page. They are run using the JVM installed in the Web Browser. Not all web browsers have a JVM installed, but one can be freely installed from Sun at http://www.java.com.
Embedding applets into a Web Page is easy, they are formatted just like other HTML code and use the
Here we use two optional tags width and height to say how large a space (in pixels) to make for the applet on the web page.
Once you save the HTML file, all you need to do is put your helloWorld.class file in the same directory, and then load the HTML page in your browser and you should be able to see the results.
You can also download applets already created by other people and posted on the Internet to use in your Web pages. Many resources exist such as Java Boutique (http://javaboutique.internet.com/applets/) that has hundreds of free applets for you to use.