File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Drawing a Rectangle, Oval, and Square Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Drawing a Rectangle, Oval, and Square" Watch "Drawing a Rectangle, Oval, and Square" New topic

Drawing a Rectangle, Oval, and Square

Michael Taylor

Joined: Jun 19, 2002
Posts: 15
I am trying to write a program where the user clicks on a button labeled "Rectangle", "Oval", or "Square" and when that action is performed the appropriate shape is display. Can someone look at the partial code below and give me some pointers?

Any help would be appreciated.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
How have you considered organizing your project? What objects might the project need and what heirarchy might they create? Are you trying to work polymorphism into your project?
If you'd like to learn a bit about what polymorphism is, take a look at The "How My Dog Learned Polymorphism" Story in The Campfire Stories.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Drawing a Rectangle, Oval, and Square
Similar Threads
Quick ArrayList Question
why do we always have rectangular or square frames or windows why not ovel
Shape of Frame
Good design?
Help with drawing random shapes based on JComboBox