Question: When I draw lines in my program the position is perfect, but when I use those same coordinates for a square or oval they are way off the mark. My code is:

```
g2d.drawRect(one1, one2, two1, two2);
g2d.drawOval(one1, one2, two1, two2);

```

And the points are gather by:

```
one1 = (int)e.getX();
one2 = (int)e.getY();

```

This is a follow on to a [question I previously asked](https://stackoverflow.com/questions/8479432/lines-arent-drawing-exactly-where-i-clicked).

Answer: 
I think I understand what your issue is. You are having the user click in two different spots on the canvas and then you want to draw a rectangle/oval using those points. So if the user clicks at 10,10 and then clicks at 20,20, then you want a rectangle whose top left corner is at 10,10 and whose bottom right corner is at 20,20.

If this is in fact what you are asking, then here is my proposed solution:

```
Event e1 = (the first click)
Event e2 = (the second click)

// Figure out where the user clicked
int x1 = (int)e1.getX();
int y1 = (int)e1.getY();

int x2 = (int)e2.getX();
int y2 = (int)e2.getY();

int xCoord;
int yCoord;

// Figure out the coordinates
if(x1 < x2)
    xCoord = x1;
else
    xCoord = x2;

if(y1 < y2)
    yCoord = y1;
else
    yCoord = y2;

// Figure out the size of the object
int width = Math.abs(x1 - x2);
int height = Math.abs(y1 - y2);

// Finally draw your objects
g2d.drawRect(xCoord, yCoord, width, height);
g2d.drawOval(xCoord, yCoord, width, height);

```

That should work for you based on my understanding of your question.
My guess is that you're capturing the X & Y coordinates for a container (say 200,200) then creating the oval/rect within a NEW container; you state a JLabel above in your comment.

If you're capturing X & Y to be 200,200 for a JPanel, then creating a JLabel and assigning the component an X/Y of 200,200 it is the coordinate within its new component, not the parent in which you captured the X/Y.

Can you post the code where the MouseListener is initiated as well as when the JLabel is created if this is wrong? As others have said we need more code to work from. An image example would be equally beneficial!