keyListener problem
Hello. I have made an keyListener. But it dosent work as I whant to. The problem is that I never make a match into my "if". Any idea why?
// the key listener class where I convert the char to an String
publicvoid keyPressed(KeyEvent e){
perf.key(e.getKeyChar()+"");
view.repaint();
}
// the key method and it never go into my first "if" statement. Why?
publicvoid key(String str){
if(str =="q"){
array[0][0] ="a";
}
// always just gets here and put in a "b"
else array[0][0] ="b";
}
Thanks in advance!

