Set the label above your do-while loop:
label:
do{
String name;
name = JOptionPane.showInputDialog("Enter Username");
String pass = JOptionPane.showInputDialog("Enter Paswword");
String captcha = JOptionPane.showInputDialog("3 * 6 = ");
int captchaAnswer = Integer.parseInt(captcha);
switch(captchaAnswer){
case 18:
JOptionPane.showMessageDialog(null,"You are a Human","Login Sucessfull",JOptionPane.INFORMATION_MESSAGE);
break label;
default:
JOptionPane.showMessageDialog(null,"You are not a Human", "Login Failed",JOptionPane.ERROR_MESSAGE);
}
loginData[loginDataIndex] = name;
loginDataIndex++;
--tries;
JOptionPane.showMessageDialog(null,"You are Left with "+tries+" tries.","Tries Left",JOptionPane.WARNING_MESSAGE);
}while(tries>0);