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.

Results 1 to 11 of 11

Thread: Can you please help me figure out what's wrong with my code?

  1. #1
    Member
    Join Date
    Sep 2013
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Question Can you please help me figure out what's wrong with my code?

    Hello everyone,


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,124
    My Mood
    Mellow
    Thanks
    186
    Thanked 658 Times in 645 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    Post the error and stack trace, copied and pasted from exactly as it appears at your end.

  3. #3
    Member
    Join Date
    Sep 2013
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    Hope you're having a good day

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,124
    My Mood
    Mellow
    Thanks
    186
    Thanked 658 Times in 645 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    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.

  5. #5
    Member
    Join Date
    Sep 2013
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    However my code could not stay

  6. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,124
    My Mood
    Mellow
    Thanks
    186
    Thanked 658 Times in 645 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    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);

    ?

  7. #7
    Member
    Join Date
    Sep 2013
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    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

  8. #8
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,124
    My Mood
    Mellow
    Thanks
    186
    Thanked 658 Times in 645 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    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.

  9. #9
    Member
    Join Date
    Sep 2013
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Re: Can you please help me figure out what's wrong with my code?


  10. #10
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,124
    My Mood
    Mellow
    Thanks
    186
    Thanked 658 Times in 645 Posts

    Default Re: Can you please help me figure out what's wrong with my code?

    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.

  11. #11
    Member
    Join Date
    Sep 2013
    Posts
    36
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Re: Can you please help me figure out what's wrong with my code?


Similar Threads

  1. Cannot figure out why this is wrong............
    By gabgab96 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: February 27th, 2013, 05:58 AM
  2. Can't figure out why this is wrong
    By gabgab96 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 26th, 2013, 09:25 PM
  3. Simple sorting program, can't figure out whats wrong with my code
    By USC CSCE in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 29th, 2012, 07:38 AM
  4. Can't figure out what's wrong
    By xdx in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 10th, 2012, 08:48 AM
  5. i cannot figure out what's wrong
    By biyuss in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 17th, 2011, 09:22 PM