Page 3 of 3 First 123
  • Jump to page:
    #31
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    20
    Rep Power
    0
    Originally Posted by NormR
    If you want help make the small program for testing.
    If I make it any smaller it won't run, I mean really.
  2. #32
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Remove the code that is not related to the problem. For example there doesn't need to be a GUI. You said The problem is with a method in one class calling a static method in another class.
  4. #33
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    20
    Rep Power
    0
    Originally Posted by NormR
    Remove the code that is not related to the problem. For example there doesn't need to be a GUI. You said The problem is with a method in one class calling a static method in another class.
    But that's the issue, if I remove most of the classes it does work, so the issue is in what I uploaded.
  6. #34
  7. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    if I remove most of the classes it does work
    Then remove the code in small pieces, compile and test. If it works remove some more compile and test. Continue.
    When the error happens you will know that the last bit of code that was removed is related to the problem.

    I don't use an IDE. The code in your zip has files all over the place. To compile and test the code I need all the classes in one file.
  8. #35
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    20
    Rep Power
    0
    Originally Posted by NormR
    Then remove the code in small pieces, compile and test. If it works remove some more compile and test. Continue.
    When the error happens you will know that the last bit of code that was removed is related to the problem.

    I don't use an IDE. The code in your zip has files all over the place. To compile and test the code I need all the classes in one file.
    So I followed your advice and found out what was causing the error. It seems that when I removed this line:
    Code:
    public static String response = Keyboard.getLine();
    the application was fixed. Here is the method:
    Code:
    import java.util.Scanner;
    
    public class Keyboard {
    	
    	 static Scanner keyboard = new Scanner(System.in);
    	 
    	 public static String getLine(){
    		 return keyboard.nextLine();
    	 }
    
    }
    Any idea why this would break the application?
  10. #36
  11. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Good work finding that.
    Code:
    public static String response = Keyboard.getLine();
    Where was that line and what caused it to be being executed?

    That line would cause the program to be waiting for the user to enter something on the keyboard.
Page 3 of 3 First 123
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo