More Related Content More from miguelcastromejia (12) Casa1. Pedro Antonio González Martínez
Código
g.setColor(new Color(153, 50, 000));
/* g.fillRect(400, 220, 100, 180);
* To change this template, choose Tools | Templates
* and open the template in the editor. g.setColor(Color.BLACK);
*/ g.fillOval(470, 300, 20, 20);
package casapedrito;
int x = 700;
import java.awt.*; int y = 500;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; }
class Casita extends Frame { public void mostrar() {
setVisible(true);
Casita(int ancho, int alto) {
setSize(ancho, alto); }
setLocationRelativeTo(null);
setResizable(false); public static void main(String args[]) {
Casita ver = new Casita(800, 650);
addWindowListener(new WindowAdapter() { ver.mostrar();;
}
public void windowsClosing(WindowEvent e) { }
System.exit(0);
} Imagen
public void windowClosed(WindowEvent e) {
System.exit(0);
}
});
}
public void paint(Graphics g) {
g.setColor(new Color(200, 255, 255));
g.fillRect(0, 10, 1800, 600);
g.setColor(new Color(255, 220, 70));
g.fillRect(103, 100, 596, 350);
g.setColor(Color.white);
g.fillRect(205, 175, 170, 140);
g.setColor(Color.black);
g.fillRect(205, 240, 170, 5);
g.fillRect(285, 175, 10, 140);
g.setColor(Color.green);
g.fillRect(0, 400, 900, 250);
g.fillOval(180, 500, 250, 100);
g.setColor(Color.black);
Font f = new Font("Cooperlate", Font.BOLD, 14);
g.setFont(f);
g.drawString("Casa de Pedrito", 250, 160);
g.setColor(new Color(153, 102, 000));
g.fillRect(600, 200, 50, 350);
g.setColor(new Color(0, 200, 1));
g.fillOval(530, 190, 130, 220);
g.fillOval(600, 100, 130, 220);
g.fillOval(530, 100, 130, 220);
g.fillOval(600, 190, 130, 220);