I am interested in drawing a Rectangle object using AWT methods (I know, it's old). I have looked at other code on the forum that has answers, but they are not working for me. Here is what I am looking to do...
paint(Graphics g) {
Rectangle r = new Rectangle(5,5,20,20);
g.drawRect(r.getX(),r.getY(),r.getWidth(),r.getHeight());
}
But what I have to do is:
g.drawRect((int)r.getX().........);
and cast every value to an int. Am I doing something wrong? The code examples that I found have the solution without the casting. If I don't cast, I get an error. Surely, there should be something more simple.
Thanks in advance.