1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
package test;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
public class Test extends JApplet
{
private static final long serialVersionUID = 1;
private int x1 = 100;
private int x2 = 150;
private int y1 = 200;
private int y2 = 300;
private int z1 = 320;
public void paint(Graphics g)
{
g.setColor(Color.BLUE);
g.drawLine(x2, x1, y1, y1);
g.drawLine(y1, y1, y1, y1);
g.drawLine(y1, y2, x1, y2);
g.drawLine(x1, y2, x1, y1);
g.drawLine(x1, y1, x2, x1);
g.drawLine(x1, y1, y1, y1);
g.drawLine(y1, y1, x1, y2);
g.drawLine(x1, y1, y1, y2);
g.setColor(Color.RED);
g.drawString("Ceci est une maison...", x1, z1);
}
} |
Partager