Comparing a character with characters within a string
When I run the applet that uses this piece of code I get the following error:
ALERT: java/lang/ClassFormatError: Bad version information.
public void checkInput()
char gletter = 'x';
//split String into stringArray
stringArray = sword.toCharArray();
byte swordBytes = sword.getBytes();
for(int i = 0; i < sword.length; i++)
if(i < swordBytes.length)
if(byte[i] swordBytes comparesTo gletter) <---byte gives a syntax error (I really don't know what I actually have to put here, I've tried multiple things like string and char. swordBytes gives a 'cannot be resolved to a type' error. [i] gives an error saying I need to place a ")".
frame[i+14] = gletter;
If someone could explain what I am doing wrong, it would be highly appreciated.