Topics: Console, Graphics, Applet
<APPLET CODE="hello_java.class" WIDTH=300 HEIGHT=100> Text that won't be seen if the client's browser interprets java ("sorry your browser doesn't support java") </APPLET>
So, if you were to add the above code to your HTML file, and the myapp.class were in the same folder, the applet should occupy 300x100 pixels of the document.
import java.applet.*; public class hello_java extends Applet { public void init() System.out.println("hello"); } }The above code must be in a file called hello_java.java, and compiled to make the .class file referred to in the HTML file. What it does is simply to print the system message to the JAVA CONSOLE. That is a substitute for the "standard output." So, for example, since Macs don't have a command line, the "system" messages from an applet are sent to the Console, a shell-like window that can be opened in Netscape. PCs use a DOS window to display the console messages. Such messages can be useful to you when writing applets. If you want to see some of the data values during execution of a program, they can be printed to the console using the System.out.println method. To see the applet go to book/hello_java.html