package tutorial;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
public class Dibujo extends Canvas {
public Dibujo(){
setBackground(Color.black);
}
public void paint (Graphics g) {
g.setColor(Color.GREEN);
g.fillRect(20, 30, 150, 160);
g.setColor(Color.blue);
g.drawRect(250, 250, 80, 100);
g.setColor(Color.CYAN);
g.drawLine(60, 60, 300, 400);
g.setColor(Color.ORANGE);
g.drawArc(100, 100, 300, 300, 0, 90);
g.drawOval(40, 40, 60, 60);
g.drawRoundRect(90, 90, 200, 200, 10, 10);
g.drawString("Hola Angelica",200,200);
int [] x = {100,150,170,190,200};
int [] y={120,280,200,250,60};
g.setColor(Color.blue);
g.fillPolygon(x, y, x.length);
}
}
No hay comentarios:
Publicar un comentario