Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Drawing Simple Shapes e.g. Rectangle (Newbie to Java)

843807Nov 24 2006 — edited Nov 24 2006
Hello all,
being a newbie, i tried to write a simple GUI but ran into some problems.

Basically, i have an AWT Frame with an AWT Panel inside the frame.

I would like to do the following - draw a rectangle anytime a mouse is clicked at the coordinates of the click.

Note: am not only drawing one rectangle and move it to the position of the click. I want to keep drawing a rectangle everytime a click happens.

Also, i am using AWT and not Swing for platform issues.

Any help will be greatly appreciated.

Thanks a lot in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2006
Added on Nov 24 2006
5 comments
222 views