Search:

Type: Posts; User: Norm

Search: Search took 0.21 seconds.

  1. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Where do each of the cars get their speed from? Check the code.
  2. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    How does the user tell the program that there is data now? The timer is going to get the data every 50ms even if the user is not ready.
  3. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    If you are getting the numbers BEFORE the user has entered them, that doesn't make sense.
    The program should show the GUI and wait for the user to enter the data and to tell the program that the...
  4. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Where does text1 get assigned a value? It will be null if no value is assigned to it. If it is null, then parseInt() will throw the exception. So you must change the code to make sure text1 gets a...
  5. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Is the value of text1 null? How and where does text1 get assigned a value? How does it get a null value?
  6. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Why is the code passing a null value to the parseInt() method called on line 72?



    one = new JTextField("",3);
    text1 = one.getText();
    Car1 = Integer.parseInt(text2); <<<<<<< note text2 here...
  7. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Please explain what happens. Add some println() statements to the code that prints out the value of the String passed to the parseInt() method and to print out the value of the int returned by...
  8. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    If the user is not entering numbers in the textfields, initialize them with numbers:

    JTextField one = new JTextField("25", 3);


    Is that because their values are all being changed by the same...
  9. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Are the "speeds" textfields? What are the variable names for those text fields? Where does the program get the contents of the textfields so they can be converted to int values and used to control...
  10. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    There is a variable with a null value on line 129. Look at line 129 in the your source and see what variable is null. Then backtrack in the code to see why that variable does not have a valid value....
  11. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Did you see this part of what was printed:
    That shows that the one variable has a null value.
    Look back through the code to see why that variable: one does not have a valid value.
  12. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    System.out.println("big.add(one)");
    That prints a String (the stuff between the "s). It does NOT print the values of any variables.
    There are two variables in that source statement: big and one...
  13. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Code a System.out.println() for each variable on line 86.

    Please post the code to explain how the code skipped to line 92.
  14. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    There is a variable with a null value on line 86. Look at line 86 in the your source and see what variable is null. Then backtrack in the code to see why that variable does not have a valid value....
  15. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Is the method they are in called? Add a call to the println() method to print a message when the actionPerformed() method is executed.

    Nested statements within {} should be indented 3-4 spaces to...
  16. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Please edit the posted code and properly format it. Nested statements within {} should be indented 3-4 spaces to make the code easier to read and understand. Statements should NOT all start in the...
  17. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Please post the current version of the code.


    Use a Timer or some other technique to change the x,y locations where the images are drawn.
  18. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    The formatting of the code needs to be fixed so it can be read and understood. The }s should not all be in the first column. They should be in line beneath the start of the statements with the {...
  19. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Please copy the full text of the error message and paste it here.
  20. Replies
    40
    Views
    2,771

    Re: Help with racecar applet?

    Please copy the full text of the error messages and paste them here.
    Here is a sample:


    TestSorts.java:138: cannot find symbol
    symbol : variable var
    location: class TestSorts
    var =...
Results 1 to 20 of 20