public interface GPrintable
import ch.aplu.util.*;
public class PrintTest extends GPanel implements GPrintable
{
public PrintTest()
{
draw(); // Draw on screen
print(this); // Draw on printer
}
public void draw()
{
move(0, 0);
draw(0, 1);
draw(1, 1);
draw(1, 0);
draw(0, 0);
line(0, 0, 1, 1);
line(0, 1, 1, 0);
}
public static void main(String[] args)
{
new PrintTest();
}
}
Modifier and Type | Method and Description |
---|---|
void |
draw()
This method must perform all drawing operations.
|