Results 1 to 2 of 2
- 04-30-2009, 04:02 PM #1
Member
- Join Date
- Mar 2009
- Location
- Cheshire
- Posts
- 6
- Rep Power
- 0
Image appear at random co-ord within jpanel
'm doing a Java Project, based on a shooting gallery type game. I am in need of a bit of help on how an image at random within co-ordinates specified in the panel? I presume this would be easier with the use of threads, but i'm stuck on how to implement this.
The game will use 3 different images, which will each have a different score value when clicked, so they must be treated individually. If anybody could help, or understands what I'm after that would be great?
-
You'll likely want to do your drawing inside of the JPanel's paintComponent(Graphics g) method, and most likely instead of separate threads, use a Swing Timer object to do any animation. If you search this forum, the Sun Java forum on these terms, you'll likely get hits on example code, some of it even good.
Much luck.
Similar Threads
-
How do I generate random numbers in a certain range using the random class?
By frasifrasi in forum New To JavaReplies: 8Last Post: 04-19-2009, 05:50 PM -
How to display image from byte array in JPANEL
By waqasdaar in forum AWT / SwingReplies: 0Last Post: 03-22-2009, 12:11 AM -
how to set image to a jpanel
By masa in forum AWT / SwingReplies: 1Last Post: 03-02-2009, 08:36 AM -
n00b : Ghost image while using mouseDragged event to move a filled jPanel
By ankitmcgill in forum New To JavaReplies: 5Last Post: 11-02-2008, 06:41 AM -
Random Image on Refresh (FROM Folder not set number)
By QuinnMal in forum Java ServletReplies: 1Last Post: 07-06-2007, 07:27 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks