private void calculateSerial(){
boolean fakeSuccess=false;
String name = textField1.getText();
String serial = textField2.getText();
if(name.length()==0 || serial.length()==0)
label3.setText(
new Character('Y').toString() +
new Character('o').toString() +
new Character('u').toString() +
new Character(' ').toString() +
new Character('M').toString() +
new Character('u').toString() +
new Character('s').toString() +
new Character('t').toString() +
new Character(' ').toString() +
new Character('E').toString() +
new Character('n').toString() +
new Character('t').toString() +
new Character('e').toString() +
new Character('r').toString() +
new Character(' ').toString() +
new Character('A').toString() +
new Character(' ').toString() +
new Character('N').toString() +
new Character('a').toString() +
new Character('m').toString() +
new Character('e').toString() +
new Character(' ').toString() +
new Character('A').toString() +
new Character('n').toString() +
new Character('d').toString() +
new Character(' ').toString() +
new Character('A').toString() +
new Character(' ').toString() +
new Character('S').toString() +
new Character('e').toString() +
new Character('r').toString() +
new Character('i').toString() +
new Character('a').toString() +
new Character('l').toString()
);
else{
char[] charName = name.toCharArray();
char[] charSerial = serial.toCharArray();
Character[] chName=new Character[charName.length];
Character[] chSerial = new Character[charSerial.length];
if(chName[0].compareTo(chSerial[4]) == 0){
if(chSerial[0].compareTo(chSerial[8]) == 0){
int tmp = (int) ((Character.getNumericValue(charName[1])+
Character.getNumericValue(charName[2])+
Character.getNumericValue(charName[3]))/3);
if( Character.getNumericValue(charSerial[2]) == tmp){
int tmp1 = (int) ((Character.getNumericValue(charName[charName.length-3])+
Character.getNumericValue(charName[charName.length-2])+
Character.getNumericValue(charName[charName.length-1]))/3);
if( Character.getNumericValue(charSerial[6] )== tmp1){
fakeSuccess=true;
}
}
}
}
}
if(fakeSuccess)
label3.setText(
new Character('T').toString() +
new Character('r').toString() +
new Character('y').toString() +
new Character(' ').toString() +
new Character('A').toString() +
new Character('n').toString() +
new Character('o').toString() +
new Character('t').toString() +
new Character('h').toString() +
new Character('e').toString() +
new Character('r').toString() +
new Character(' ').toString() +
new Character('A').toString() +
new Character('p').toString() +
new Character('p').toString() +
new Character('r').toString() +
new Character('o').toString() +
new Character('a').toString() +
new Character('c').toString() +
new Character('h').toString() +
new Character('.').toString() +
new Character(' ').toString() +
new Character('R').toString() +
new Character('e').toString() +
new Character('g').toString() +
new Character('i').toString() +
new Character('s').toString() +
new Character('t').toString() +
new Character('r').toString() +
new Character('a').toString() +
new Character('t').toString() +
new Character('i').toString() +
new Character('o').toString() +
new Character('n').toString() +
new Character(' ').toString() +
new Character('F').toString() +
new Character('A').toString() +
new Character('I').toString() +
new Character('L').toString() +
new Character('E').toString() +
new Character('D').toString()
);
else
label3.setText(
new Character('I').toString() +
new Character('n').toString() +
new Character('v').toString() +
new Character('a').toString() +
new Character('l').toString() +
new Character('i').toString() +
new Character('d').toString() +
new Character(' ').toString() +
new Character('S').toString() +
new Character('e').toString() +
new Character('r').toString() +
new Character('i').toString() +
new Character('a').toString() +
new Character('l').toString() +
new Character('.').toString() +
new Character(' ').toString() +
new Character('T').toString() +
new Character('r').toString() +
new Character('y').toString() +
new Character(' ').toString() +
new Character('A').toString() +
new Character('g').toString() +
new Character('a').toString() +
new Character('i').toString() +
new Character('n').toString()
);
}
textField1.setText("");
textField2.setText("");
}