I am having a hard start here. I am trying to write my first
applets and I cannot even get the System.out.println method to work. Since I cannot even print "hello world" this is not very fun. Here is an example below that I typed in out of Roberts/Heller about event handling. I think the event handling would work if I could get the text to print...
It compiles but I can not get any simple strings to print. Maybe they are printing the same color as the background?
All help appreciated. There are tufts of hair on my desk I am so frustrated!
Here is my short program:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
class MyActionListener implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
System.out.println("Action Performed");
}
}
public class ListenerTest extends Applet
{
public void init()
{
Button btn = new Button("OK");
MyActionListener listener = new MyActionListener();
btn.addActionListener(listener);
add(btn);
}
}