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 Game Development and the fly likes Need help in ball breaker game 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 » Game Development
Bookmark "Need help in ball breaker game" Watch "Need help in ball breaker game" New topic
Author

Need help in ball breaker game

rahul taiwala
Greenhorn

Joined: Feb 06, 2011
Posts: 12
hello every body i have some painting problem with the game can anybody help.....
here is the code



[Thumbnail for Untitled.jpg]

rahul taiwala
Greenhorn

Joined: Feb 06, 2011
Posts: 12
use paint method instead of paintComponent and its working fine.....
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
rahul taiwala wrote:use paint method instead of paintComponent and its working fine.....


This solution sounds very wrong. Sorry but it sounds like you're fixing the wrong thing, but I can't say what since I can't get your code to compile or run due to missing classes. One problem I see that is not causing your main question but can bite you later is that you have program logic within your paint/paintComponent method as indicated by my comment // **** here ****:



and program logic should not be in this method as you do not have full control as to when or if it will be called. Also it is strange to see a repaint() call within a paint/paintComponent method. If the JVM weren't smart, this would cause an infinite recursive cycle.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help in ball breaker game
 
Similar Threads
keyboard arrow keys not working
How to shrink/grow lines
Help with drawing objects on panel
Suggestions to make code (Pong) better (from the code I have, not adding additional code)
How to transfere ActionListener to anothe Class