I am writing a program where you enter in four int variables and than uses those to draw the oval. I'm having a problem passing the int variables into the drawoval method...Please HELP! If you wish you may email me at: email@example.com
alsjo : Can you post your code here? Have you tried to compile it ? What error do you get? At what line? Have you looked up the API for details on the drawOval method? How are you capturing the values that are to be the arguments to the drawOval method?
Alsjo : You are declaring the variables in one method ( init() ) and using them in another( Paint() ). Variables declared in one method are available only in that method. Also how are you getting values in the String variables that correspond to the X, Y etc? I am getting the following errors as well for all the four string variables "Variable inbottom may not have been initialized."
Ok, I declared the variables globally now I'm getting the following error. cannot resolve symbol symbol : method drawoval (int,int,int,int) location: class java.awt.Graphics g.drawoval(x, y, right, bottom ); ^
alsjo, Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please re-register under an appropriate name as shown in the policy. Your display name should have two names separated by a space and not obviously fictitious. Thanks again and we hope to see you around the ranch!!
"JavaRanch, where the deer and the Certified play" - David O'Meara
get schwifty. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss