JFreeChart: XYCoordinate

Posted on 2011-04-23
Last Modified: 2012-05-11
I'm looking for any easy was to make a copy of an XYCoordinate object.
I don't see a copy constructor or a clone() method.

It seems the best I can do is:
new XYCoordinate (myXYCoordinate.getX(), myXYCoordinate.getY());

Is this it?
Question by:allelopath
    LVL 47

    Accepted Solution

    No you need
    to have it like that:
    XYCoordinate  one = new XYCoordinate(5.0, 10.0);
    XYCoordinate second = new XYCoordinate(one.getX(), one.getY());
    LVL 47

    Assisted Solution

    YOu are right, as they didn't override the clone() method, it would not work otherwise

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Title # Comments Views Activity
    zeroMAx challenge 20 66
    FizzBuzz challenge 9 64
    hash value 2 29
    count7 challenge 12 52
    If you have upgraded to Java2 update 10 on a Microsoft Windows client, you may have discovered that your Java application does not work as it did before.  For example, the colors of your Java2D graphic may be all wrong for no apparent reason. Aft…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now