Results 21 to 22 of 22
Making randomX and randomY static is a kludge to fix another error somewhere else in your program. I have a feeling that some other class is changing the values of these numbers elsewhere, but you don't reflect those changes back to the class that needs the information, the one with the two random methods above, but it's impossible to say where the error is in code not shown.
Correction: It is more likely that you have multiple instances of the IRPanel class, perhaps you don't even realize that you do (check to see if and where you call new IRPanel()). If so, you may be assuming that changes to one will cause changes to another, and that won't happen. The solution is to have only one instance of this class and pass references to it where it is needed.
- By avizana in forum NetworkingReplies: 2Last Post: 03-14-2011, 08:43 PM
- By AcousticBruce in forum New To JavaReplies: 1Last Post: 01-08-2011, 05:10 PM
- By kmm1977 in forum AWT / SwingReplies: 4Last Post: 06-21-2010, 12:04 PM
- By ibrahimyoussof in forum AWT / SwingReplies: 2Last Post: 04-17-2010, 03:51 PM
- By jaiminparikh in forum Advanced JavaReplies: 7Last Post: 03-21-2009, 04:20 AM