29
Sep
g.setColor(Color.lightGray); g.fillRect(80,100,110,90); g.setColor(Color.red); g.fillRect(200,0,45,45); g.fillRect(0,100,70,200); g.setColor(Color.magenta); g.fillRect(200,55,60,135); }
g.setColor(Color.lightGray); g.fillRect(80,100,110,90); g.setColor(Color.red); g.fillRect(200,0,45,45); g.fillRect(0,100,70,200); g.setColor(Color.magenta); g.fillRect(200,55,60,135); } public void stop() { System.out.println(”>> stop <<"); } public void destroy() { System.out.println(">> destroy <<"); } } The associated HTML file is shown in Listing 1-8. Listing 1-8 Mondrian applet HTML code
Since Mondrian is a subclass of Applet, it inherits all of Applet s public methods. Mondrian redefines, or overrides, some of Applet s methods init(), start(), paint(), stop(), and destroy() to provide the appropriate behavior. You ll learn what these particular methods do in the following section. For now, let s run the applet. First, compile Mondrian.java with javac (as before):Note: If you are looking for cheap and reliable provider to host and run your servlet application check Vision servlet hosting services
