This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
this is the code which draws the star image to the frame
while using the normal paint method it refreshes the frame and draws the star image but while using the paintcomponent method the image is getting dragged and while using paintchildren the image is drawn as that of normal paint method
would anybody explain what is exactly happening and the difference between these three paint methods.
I don't see where y is getting set to anything but 0, but I didn't do an exhaustive examination of the code. I think your problem is here:
Try this instead:
Calling the super method makes it behave like a regular JComponent, but still implements your painting. You may have to set the component to transparent (setOpaque(false)), but other than that, it should behave like you expect it to. HTH
"What you are good at is not as important as being good at something." --Robert B.Parker
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com