import java.awt.*;
import java.applet.*;
public class HelloLine extends Applet {
int a; int b; int c; int d;
boolean first = true;
public void paint(Graphics g) {
g.drawString(first + " - " + a + " - " + b + " - " + c + " - " + d, 10, 20);
g.drawLine(a, b, c, d);
}
public boolean mouseUp(Event e, int x, int y) {
if ( first ) {
a = x;
b = y;
first = false;
} else {
c = x;
d = y;
first = true;
}
repaint();
return true;
}
}Appletit:
DoupleClick HelloButton HelloButtonExample1 HelloButtonExample2 HelloButtonExample3 HelloButtonExample4 HelloClick HelloClick2 HelloColor HelloFont HelloImage HelloLine HelloStatus HelloWorld2 HelloWorldApplet MyEvent ScrollingText
Itsenäiset:
Break Continue HelloWorld Jatka Kertoma Kertotaulu Koe KoeNro LueMerkki LueMjonoon LueTied Merkkijono Silmukat Summaa Tahdet Tietotyypit Tilavuus Laskuri EnsimmaisetMetodit Lue LueTietoja Muunnos MuuttujienAlkeet Tulostus Arpanoppa