miércoles, 18 de mayo de 2011

PROGRAMA QUE PERMITE SELECCIONAR LOS ANIMALES



 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        String mensaje="animales elegidos:  ";
        if (this.jCheckBox1.isSelected()){
            mensaje=mensaje+"Perro, ";
        }
        if (this.jCheckBox2.isSelected()){
            mensaje=mensaje+"Gato, ";
         }

        if (this.jCheckBox3.isSelected()){
            mensaje=mensaje+"raton";
        }
       this.jLabel2.setText (mensaje);{
          
       }

    }                                       

No hay comentarios:

Publicar un comentario