//dibujar rectangulos import java.awt.*;
import java.applet.*;
public class Lineas extends Applet{
public void paint(Graphics g)
{
g.drawLine(0, 0, 100, 100);
g.drawLine(0,100, 100,0);
g.drawLine(40, 25, 250, 180);
g.drawLine(75, 90, 400, 400);
g.drawLine(20, 150, 400, 40);
g.drawLine(5, 290, 80, 19);
}
}
Ejercicio 1
Ejercicio 2
import java.awt.*;
import java.applet.*;
public class Rectangulos extends Applet{
public void paint (Graphics g) {
g.drawRect(10, 10, 60, 50 );
g.fillRect(100, 10, 60, 50);
g.drawRoundRect(190, 10, 60, 50, 15, 15);
g.fillRoundRect(70, 90, 140, 100, 30, 40);
}
}
import java.awt.*;
import java.applet.*;
public class Elipses extends Applet{
public void paint (Graphics g){
g.drawOval(10, 10, 50, 50);
g.fillOval(100, 10, 75, 50);
g.drawOval(190, 10, 90, 30);
g.fillOval(70, 90, 140, 100);
}
}
1 comentario:
Te felicito Cindy , portate bien
Publicar un comentario