Results 1 to 2 of 2
- 04-30-2009, 05:02 PM #1Member
- Join Date
- Mar 2009
- Rep Power
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.
- By frasifrasi in forum New To JavaReplies: 8Last Post: 04-19-2009, 06:50 PM
- By waqasdaar in forum AWT / SwingReplies: 0Last Post: 03-22-2009, 01:11 AM
- By masa in forum AWT / SwingReplies: 1Last Post: 03-02-2009, 09:36 AM
- By ankitmcgill in forum New To JavaReplies: 5Last Post: 11-02-2008, 07:41 AM
- By QuinnMal in forum Java ServletReplies: 1Last Post: 07-06-2007, 08:27 PM