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.
I do have an example now of where the circle shape grows in size when the height value is changed due to a scroll bar adjustment but I have no call to the repaint() method in the panel. Why then, when normally I expect to have to call repaint() to update the screen, does this work in my code below without any explicit call to repaint but just changing the scroll value?
We don't want the comment, we want the imports so we don't have to waste time guessing what they are.
my main method ... my frame class
Don't create separate classes. Put everything in one class. The goal of a SSCCE is to make it "easy for us" (not easy for you) to test your code and help solve the problem.
Why then, when normally I expect to have to call repaint() to update the screen, does this work in my code below without any explicit call to repaint but just changing the scroll value?
Swing components know when to repaint themselves when a property changes. When you change the text of a label the following code is executed:
The first though might be that only the label itself needs to be repainted, but I guess some changes might also affect the parent. Iguess because the size of the component might change the layout of the parent also needs to be considered, which leads to the panel also repainting itself.
Try using the following to see the difference:
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
subject: Do certain events make calls to repaint redundant? (Part 2)