File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Drawing ovals and rectangles in JApplet with two separate buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Drawing ovals and rectangles in JApplet with two separate buttons" Watch "Drawing ovals and rectangles in JApplet with two separate buttons" New topic
Author

Drawing ovals and rectangles in JApplet with two separate buttons

Akira belliveau
Greenhorn

Joined: Oct 09, 2013
Posts: 25
First off, I'm sorry for the long code I'm just not quite sure what the problem is. I've been messing around with this program for a couple of hours now and I am just stumped. I'm not exactly sure what the draw button is supposed to do specifically, all i know is that it is supposed to draw both rectangles and ovals. The problem I am having is that when ever I click Draw Rectangle, it draws rectangles jusst the way I want but when ever I click Draw Oval, the program keeps drawing rectangles. I've tried repaint and clearRect methods but I did not manage to get them to work. I'm not sure what the problem is right here, I just cannot get it to work. Is there anything you guys can see that might be causing this? It's always good to have a different person look at it then myself. Also, I'm trying to implement a boolean for draw oval but I don't know where to put the if then. Thanks in advance...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8



Doesn't that code say "When the btnDrawOval button is clicked, then draw rectangles"?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drawing ovals and rectangles in JApplet with two separate buttons