Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22
  1. #21
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  2. #22
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. get url returned by search
    By avizana in forum Networking
    Replies: 2
    Last Post: 03-14-2011, 07:43 PM
  2. 2 Items returned on itemStateChanged() Test???
    By AcousticBruce in forum New To Java
    Replies: 1
    Last Post: 01-08-2011, 04:10 PM
  3. SplashScreen.getSplashScreen() returned null
    By kmm1977 in forum AWT / Swing
    Replies: 4
    Last Post: 06-21-2010, 11:04 AM
  4. SplashScreen.getSplashScreen() returned null
    By ibrahimyoussof in forum AWT / Swing
    Replies: 2
    Last Post: 04-17-2010, 02:51 PM
  5. Cant we have two values returned from a method in a class
    By jaiminparikh in forum Advanced Java
    Replies: 7
    Last Post: 03-21-2009, 03:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •