Try to make a small simple program that compiles and executes to display the problem.
Don't bother to post more of this large, multi part code.
It needs to demonstrate only what the problem is....
Type: Posts; User: Norm
Try to make a small simple program that compiles and executes to display the problem.
Don't bother to post more of this large, multi part code.
It needs to demonstrate only what the problem is....
This is bad!!! The variable name is the same as the type name. Variables should start with lowercase.
The code is missing many variable definitions. I get 26 compile errors:
Running:...
At this point, you need to post code that compiles and executes and demonstrates the problem.
I can't make sense out of all the bits and pieces you've been posting. I need to see a complete program...
Graphics2D cannot be resolved
Do you have the correct import statement?
To get a graphics object, use the one passed to the paintComponent() method. Call the math() method from paintComponent() and use the Graphics object it receives as math()'s argument.
yes it would if the variable twostep is null. Or if the math() method expects to receive a value other than null.
Defining a variable does not give it a value (except for primitives).
What variable is null?
Where does your code assign a value to the variable.
drawString is a method of the Graphics...
Now you need to learn to read the stack trace.
Look at these lines starting at the bottom:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at...
When you get errors, it helps us solve the problem if you post all of the text of the error message here.