Hello everyone,
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hello everyone,
Post the error and stack trace, copied and pasted from exactly as it appears at your end.
Hope you're having a good day
The compiler cannot identify the the class Integer that your code says belongs to Elipse2D. It doesn't know where it is, can't find it. Is there an Integer class in the Elipse2D class? If so, post the Elipse2D class so that we can see what's going on.
However my code could not stay
Integer is a core Java "wrapper" class used to give primitive ints object characteristics (kind of). I'm not sure you need the Integer class at all, if that's what you were trying to use. What do you mean by:
Ellipse2D.Integer ellipse = new Ellipse2D.Integer(this.x, this,y, this.radius, this.radius);
Will it be correct if you change it to:
Ellipse2D ellipse = new Ellipse2D(this.x, this,y, this.radius, this.radius);
?
If I do that here is the error:
----jGRASP exec: javac -g TrafficLightOne.java
TrafficLightOne.java:31: error: Ellipse2D is abstract; cannot be instantiated
Ellipse2D ellipse = new Ellipse2D(this.x, this,y, this.radius, this.radius);
^
1 error
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
Ellipse2D.Integer ellipse = new Ellipse2D.Integer(this.x, this,y, this.radius, this.radius);
This I believe is supposed to create an ellipse when I run the viewer and look to those instance variables for a value to create the ellipse. That's how I'm understanding it anyways but I'm just beginner. Thanks for helping me out by the way
Okay, I was being a little lazy, not digging too deeply. You may be guilty of the same thing. Look at this page, especially the Ellipse section, and see if it helps.
Please learn to post your code in code/highligh/format tags. Read the Announcement topic at the top of the What's Wrong With My Code? forum. Reading all of this code mixed with your comments is unpleasant.