aspose file tools*
The moose likes Java in General and the fly likes help w/ game involving threads and drawImage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "help w/ game involving threads and drawImage" Watch "help w/ game involving threads and drawImage" New topic
Author

help w/ game involving threads and drawImage

Mike Frya
Greenhorn

Joined: Jun 26, 2003
Posts: 4
Sorry about the double post :roll:
So I am trying to write an applet that will be interactive- a picture will momentarily flash on the screen at a random spot for some short amt of time and then disappear only to appear in a dif spot. The user has to click on the picture to win.
I know that I should use 2 threads (maybe more?)but when I put the drawImage method in the 2nd thread (class ShowImage extends Thread) the method does not want to display the image. Any help would be appreciated!
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Mike,
Welcome to JavaRanch. You can delete the second post yourself by selecting the edit icon at the top. It's the one that looks like a pencil and paper. Don't delete this one though.
For your problem. Are you using swing or AWT?


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Mike Frya
Greenhorn

Joined: Jun 26, 2003
Posts: 4
Thanks for the tip! I am on a laptop
so I tend to press keys by accident as I type and
unintended things happen...
I am using AWT
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I deleted the double post before I read Mikes directions to Mike.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Originally posted by Mike Frya:
Thanks for the tip! I am on a laptop
so I tend to press keys by accident as I type and
unintended things happen...
I am using AWT

Instead of playing twenty questions with you, it might be best for you to post some code and let us take a look at it. Use the CODE button and paste (or type ) your code between the tags. AWT isn't as picky as swing is about displaying graphics outside the main event thread but it is usually wise to handle all of it in one place if you can.
Mike Frya
Greenhorn

Joined: Jun 26, 2003
Posts: 4
Here it is:
 
 
subject: help w/ game involving threads and drawImage