Código:
import java.awt.Container;
import javax.swing.*;
public class ingreso extends JApplet{
@SuppressWarnings("static-access")
public void init(){
int cuantos=3;
Object Float;
String String1;
String String2;
JTextArea areaSalida = new JTextArea();
do {
String s1 = JOptionPane.showInputDialog("Introduzca su nombre de USUARIO:" );
String s2 = JOptionPane.showInputDialog("Introduzca su CLAVE" );
if(String.valueOf(s1).compareTo("manuel")==0 && String.valueOf(s2).compareTo("arroyo")==0){
areaSalida.setText( "SU NOMBRE DE USUARIO Y CLAVE COINCIDEN, BIENVENIDO");
Container contenedor = getContentPane();
contenedor.add(areaSalida );
break;
} else{
cuantos--;
areaSalida.setText( "SU NOMBRE DE USUARIO Y CLAVE NO COINCIDEN, DIGITE AMBAS CORRECTAMENTE, SOLO LE RESTA: " +cuantos+"\tINTENTOS ");
Container contenedor = getContentPane();
contenedor.add(areaSalida );
}
} while (cuantos>0);
}
}

