TommyWillB
Registered
I'm working my way through a Java book that says only Java 2 is required... I'm not very far in and I'm already stumbling on this:
import java.awt.*;
public class RootApplet extends javax.swing.JApplet
I've compiled without any problems, but when I try to run the HTML file with the applet tag in either the IE 5.1 Preview or the Apple supplied Applet Viewer I get nothing.
It makes no difference if I use my verion or the one from the CD, so I know I'm not making a typo.
Doesn't OS X's Java 2 support swing? If not, how do I get it to?
Heres the full code of RootApplet.java:
import java.awt.*;
public class RootApplet extends javax.swing.JApplet
I've compiled without any problems, but when I try to run the HTML file with the applet tag in either the IE 5.1 Preview or the Apple supplied Applet Viewer I get nothing.
It makes no difference if I use my verion or the one from the CD, so I know I'm not making a typo.
Doesn't OS X's Java 2 support swing? If not, how do I get it to?
Heres the full code of RootApplet.java:
Code:
import java.awt.*;
public class RootApplet extends javax.swing.JApplet
{
int number;
public void init()
{
number = 225;
}
public void paint(Graphics screen)
{
Graphics2D screen2D = (Graphics2D) screen;
screen2D.drawString("The square root of " + number + " is " + Math.sqrt(number), 5, 50);
}
}