Where do each of the cars get their speed from? Check the code.
Type: Posts; User: Norm
Where do each of the cars get their speed from? Check the code.
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.
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...
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...
Is the value of text1 null? How and where does text1 get assigned a value? How does it get a null value?
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...
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...
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...
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...
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....
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.
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...
Code a System.out.println() for each variable on line 86.
Please post the code to explain how the code skipped to line 92.
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....
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...
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...
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.
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 {...
Please copy the full text of the error message and paste it here.
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 =...