import java.applet.Applet; // Imports the Applet class
import java.awt.Graphics; // Imports the Graphics class, used to draw lines, circles, squares, text, etc
/**
* The HelloWorld class implements an applet that simply displays "Hello World!".
*/
// Our HelloWorld class extends the Applet class, giving it access to all the methods of Applet.
public class HelloWorld extends Applet {
// The paint method draws anything that is in our applet on the applet screen.
// It takes a graphics object (g), that is used to draw
public void paint(Graphics g)
{
double x1;
double x2;
double y1;
double y2;
x1 = 1;
x2 = 1;
y1 = 1;
y2= 1;
double dbl = distance(x1, y1, x2, y2);
g.drawString("Logan Carl Crone", 50, 25);
g.drawString("Can You Find Me??", 250,150);
g.drawString("" + dbl, 150, 150);
distance (x1, y1, x2, y2);
}
public static double distance
(double x1, double y1, double x2, double y2) {
double dx = x2 - x1;
double dy = y2 - y1;
double dsquared = dx*dx + dy*dy;
double distance = Math.sqrt (dsquared);
return distance;
}
}