• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to finish program

 
Stephen Norris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written most of the code, but i have to get a JComboBox to display four shapes (circle, square, oval, and rectangle), then it has to draw that shape in the allotted space. The shapes have to be placed randomly around the window. I don't where in my program to place this part so that it will work and I don't know what to put in there so that it will be random spots. If someone could just help me with the circle part, then I could figure out the other shapes, I think. Here is the program:
 
Joe Ess
Bartender
Posts: 9313
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Tutorial on Performing Custom Painting covers the coordinate system (you'll need to understand it so you can randomize positions) and implementing custom components (which you'll need to understand so you can display those random shapes).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic