This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes creating random mole and removing it. 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 » Java in General
Bookmark "creating random mole and removing it." Watch "creating random mole and removing it." New topic
Author

creating random mole and removing it.

Mac Subedi
Greenhorn

Joined: Nov 11, 2011
Posts: 5
Here i Created Ovals and loop it until 3 . My question is how can i

1) Draw a Oval at a random location and
2) If there are more than 5 Oval present how can i remove a random Oval, So far i have done this:









I hope this question make sense whoever is trying to help me. Thank YOU













Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38087
    
  22
You would need to create an array of moles and remove a member of that array.
That is one way to do it. There are lots of others.

I think you ought to create a Mole class.
Mac Subedi
Greenhorn

Joined: Nov 11, 2011
Posts: 5
would you give me some hints in code. ThankYOU
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38087
    
  22
Mac Subedi wrote:would you give me some hints in code. ThankYOU
No. Sorry.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating random mole and removing it.
 
Similar Threads
Array of colors in paintComponent method.
Displaying the score of mole
How to code optimization..
Thread.sleep question
Creating Mole Program