Professional Documents
Culture Documents
Figura Giro
Figura Giro
00 2010/8/10 */
public class RatonApplet1 extends Applet implements MouseListener { static Figura f1, f2,f3,f; static Figura1 ff; static Figura2 fi;
final Color[] colores={Color.white,Color.red, Color.green, Color.blue,Color.yellow}; static int indice,indice1,indice2,indice3,x,y,x1,y1,ancho,alto; int vg; String velocidadGiro;
Choice ch1 = new Choice(); Choice ch2 = new Choice(); Choice ch3 = new Choice(); Choice ch4 = new Choice(); private final int radio = 8;
public void init() { velocidadGiro = getParameter("fps"); vg = (velocidadGiro != null) ? Integer.parseInt(velocidadGiro) : 10; x1=0; y1=0; x=12; y=12;
ch1.setBounds(200, 570, 80, 20); ch2.addItem("FIGURA"); ch2.addItem("Cuadrado"); ch2.addItem("Circulo"); ch2.addItem("Ovalo"); ch2.setBounds(40, 610, 80, 20);
/*
f1=new Figura(20, 20, 100, 100, vg, Color.YELLOW); f1.setSize(145,145); f1.start(); f2=new Figura(20, 20, 100, 100, vg*20, Color.RED); f2.setSize(145,145); f2.start();*/ add(ch1); add(ch2); add(ch3); add(ch4);
// //
add(f2); add(f1);
ch3.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { ch3_itemStateChanged(e); } }); ch4.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { ch4_itemStateChanged(e); } });
setBackground(Color.gray); addMouseListener(this);
// //
//color if(indice==0){
if(indice==1){
} if(indice==2){
x1=70; y1=70;
if((indice1==2)&&(indice!=0)&&(indice2!=0)&&(indice3!=0)){
g.dispose(); }