| | |
incrementing in if statement
![]() |
•
•
Join Date: Jan 2009
Posts: 8
Reputation:
Solved Threads: 0
if(e.getSource() == choice2) {
if(choice2.getSelectedItem().equals("Monitor")) {
choice2.setBackground(Color.GREEN);
hidebutton++
score++;
}
else {
choice2.setBackground(Color.RED);
}
choice2.setEnabled(false);
}i have this code here...
why do when i apply this method the score is
incremented to??
would you plzz help me..
whAt is wrong 2 da Code...
4 example i have a button when i pressed it...
it must be the value of hide button and score is 1...
but in my code it shows that the score is 2 and the hide button is 1...
sorry 4 my bad english...
Java Syntax (Toggle Plain Text)
hidebutton++
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
•
•
i have this code here...
why do when i apply this method the score is
incremented to??
do understand that we don't mind you having difficulties with English, we do, however, mind if you don't even bother to try typing a decent English sentence, so the " 1 kn0w wh0 y0u 4r3 " way to write your messages is not really showing us you're a real l33t-you-have-to-be-helped-first person, it shows us you're a l4zy-n0t-w1ll1ng-t0-put-1n-3ff0rt person
![]() |
Similar Threads
- c language problm, how to pass pointer to a function (C)
- C++ Performance Tips (C++)
- Shortest path kind of problem... (C++)
- Is my if statement a valid statement? (C++)
- % problem (Java)
- this code isn't working...why..plz help (C++)
- while loop in c++ help needed (C++)
Other Threads in the Java Forum
- Previous Thread: Java with browser(IE)
- Next Thread: About Pseudorandom Number Generator
| Thread Tools | Search this Thread |
add android api applet application applications array arrays automation bank binary bluetooth chat class clear client code codesnippet collections component converter database development dice digit ebook eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health html hyper ide idea image infinite input int integer invokingapacheantprogrammatically j2me java javame javaprojects jni jpanel julia linux list loop looping main map method methods mobile myregfun mysql netbeans newbie nonstatic openjavafx parameter pearl php problem program programming project recursion repositories scanner scrollbar server set sms sort sorting spamblocker sql sqlserver state storm string superclass swing swt text-file thread threads tree windows






