• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Drawing ovals and rectangles in JApplet with two separate buttons  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Marshal
Posts: 24464
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Doesn't that code say "When the btnDrawOval button is clicked, then draw rectangles"?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!