Buen dia, espero por favor me puedan ayudar
Se me ha pedido realizar un código que mostrando un mensaje pide nombre de usuario y con otro mensaje contraseña, se deben verificar con alguna establecida por uno mismo y permitir acceso notificado en un contenedor de texto: aqui les presento el código, no me quiere entrar en bien en el ciclo creo en el If:
import java.awt.Container;
import javax.swing.*;
public class ingreso extends JApplet{
// inicializar el subprograma, obtener la entrada del usuario y crear GUI
@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 CONTRASEÑA" );
if(String.valueOf(s1).compareTo("manuel")==0 && String.valueOf(s2).compareTo("arroyo")==0)
//if (s1=="manuel" && s2 =="arroyo")
{
areaSalida.setText( "SU NOMBRE DE USUARIO Y CONTRASEÑA COINCIDEN, BIENVENIDO");
Container contenedor = getContentPane();
contenedor.add(areaSalida );
System.out.println("mmmmmmmmmmm");
cuantos=0;
}
else
{
cuantos--;
areaSalida.setText( "SU NOMBRE DE USUARIO Y CONTRASEÑA NO COINCIDEN, DIGITE AMBAS CORRECTAMENTE, SOLO LE RESTA: " +cuantos+"\tINTENTOS ");
Container contenedor = getContentPane();
contenedor.add(areaSalida );
System.out.println("mmmmmmmmooooooooommm");
}
} while (cuantos>0);
areaSalida.setText("LO SENTIMOS, HA INGRESADO ERRONEAMENTE SUS DATOS 3 VECES, HASTA NUNCAAAAAAAAAAAAAAAAAAAAAAAAA");
Container contenedor = getContentPane();
contenedor.add(areaSalida );
}
}