Any java programmers here? I'm getting some strange behavior in Netbeans. Here is the code that executes if any key is pressed (evt is the event):
>jButton7.setBackground(c);
>if (evt.getKeyCode() == 192)
>{
>System.out.print("I'm here");
>jButton4.setBackground(c);
>}
If I press any key, jButton7 turns blue. If I press the key with keyCode 192, "I'm here" is displayed on the monitor but jButton4 DOESN'T change color.
It's like the conditional statement is making setBackground() unable to execute. WTF?
does it still System.out.print if you have it after the set color?
>>57176595
I guess your code runs in a loop and therefore the next iteration resets it somehow. Post the rest of the code.
Post full code (that is needed) or post stacktree so we can see what is said
>>57176620
Yes
>>57176712
How do I get the stacktree?
Switch the order of that jbutton4.setbackground and the system.out
Here's my code, guys.
http://pastebin.com/8iMbP6CT