This program simply checks to see when each method is executed. However, when I run it in an AppletViewer my applet displays absolutely nothing. Could anyone provide any suggetions? I've provided both files below. Thank you for your help. <HTML> <APPLET CODE = "LifeCycle.class" WIDTH = 450 HEIGHT = 200> </APPLET> </HTML> import java.applet.*; import java.awt.*; import java.awt.event.*; public class LifeCycle extends Applet implements ActionListener { /*Declares the names of six methods that execute during the full lifetime of the applet. Declares a button "pressButton." Declares six integers that hold the number of occurences of each of the six methods.*/ Font buttonFont = new Font("TimesRoman", Font.ITALIC,12); Label messageInit = new Label("init "); Label messageStart = new Label("start "); Label messageDisplay = new Label("display "); Label messageAction = new Label("action "); Label messageStop = new Label("stop "); Label messageDestroy = new Label("destroy"); Button pressButton = new Button("Press"); int countInit, countStart, countDisplay, countAction, countStop, countDestroy;
/*The Init() method adds one to countInit, places all components within the applet and calls the display() method.*/
public void Init() { ++countInit; add(messageInit); add(messageStart); add(messageDisplay); add(messageAction); add(messageStop); add(messageDestroy); add(pressButton); pressButton.setFont(buttonFont); pressButton.addActionListener(this); display(); } //The Start() method adds one to countStart and calls the display method.
public void start() { ++countStart; display(); }
/*The diplay method adds one to countDisplay and displays the name of each of the six methods with the current count and indicates how many times the method has executed.*/
I wonder if this forum does not like you to copy and paste. <HTML> <APPLET CODE = "LifeCycle.class" WIDTH = 450 HEIGHT = 200> </APPLET> </HTML>
Keith Gottschalk
Greenhorn
Joined: Jul 28, 2000
Posts: 8
posted
0
Maybe you are unable to use the enter key between lines. Here at last is the HTML file. <HTML> <APPLET CODE = "LifeCycle.class" WIDTH = 450 HEIGHT = 200> </APPLET> </HTML>
Keith Gottschalk
Greenhorn
Joined: Jul 28, 2000
Posts: 8
posted
0
I give up trying to send the HTML file. Sorry.
Keith Gottschalk
Greenhorn
Joined: Jul 28, 2000
Posts: 8
posted
0
I've just found the typo. My init() method was keyed Init().
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.