Book: <a href="http://filthyrichclients.org" target="_blank" rel="nofollow">http://filthyrichclients.org</a> <br />Java: <a href="http://weblogs.java.net/blog/chet" target="_blank" rel="nofollow">http://weblogs.java.net/blog/chet</a> <br />Humor: <a href="http://chetchat.blogspot.com" target="_blank" rel="nofollow">http://chetchat.blogspot.com</a>
Originally posted by Chet Haase:
Your mail seems to imply (or ask) whether simple mouse movements will entail repaints (calls to paintComponent()).............
Swing is optimized for only repainting things that have actually changed appearance, so if moving the mouse around the screen doesn't cause anything in your app to change, then there will be no calls to paintComponent().
Chet.
Yes. That was one point of confusion in my mind. The mouse scenario I had cited was an example which I thought would trigger paint/repaint as the UI needs to be repainted. Maybe instead of the mouse I should have given the scenario of some swing app running and the user toggling to some other app.
Let me see if I got this thing correct. If I have a JTable being rendered on the UI, unless the table model is changed, the paingComponent() wont be called even if I say minimized and maximised the window? Is this applicable also if I have a panel whose paintComponent I have tweaked to say display the olympic rings as a background? In a nutshell, is swing painting is optimized to figure out model changes and only then call repaint?[/QB]
Book: <a href="http://filthyrichclients.org" target="_blank" rel="nofollow">http://filthyrichclients.org</a> <br />Java: <a href="http://weblogs.java.net/blog/chet" target="_blank" rel="nofollow">http://weblogs.java.net/blog/chet</a> <br />Humor: <a href="http://chetchat.blogspot.com" target="_blank" rel="nofollow">http://chetchat.blogspot.com</a>
Yes. That was one point of confusion in my mind. The mouse scenario I had cited was an example which I thought would trigger paint/repaint as the UI needs to be repainted. Maybe instead of the mouse I should have given the scenario of some swing app running and the user toggling to some other app.
Let me see if I got this thing correct. If I have a JTable being rendered on the UI, unless the table model is changed, the paingComponent() wont be called even if I say minimized and maximised the window? Is this applicable also if I have a panel whose paintComponent I have tweaked to say display the olympic rings as a background? In a nutshell, is swing painting is optimized to figure out model changes and only then call repaint?[/QB]
Book: <a href="http://filthyrichclients.org" target="_blank" rel="nofollow">http://filthyrichclients.org</a> <br />Java: <a href="http://weblogs.java.net/blog/chet" target="_blank" rel="nofollow">http://weblogs.java.net/blog/chet</a> <br />Humor: <a href="http://chetchat.blogspot.com" target="_blank" rel="nofollow">http://chetchat.blogspot.com</a>
Originally posted by Chet Haase:
But I think your question was more about what default repainting was like.
Chet.
Book: <a href="http://filthyrichclients.org" target="_blank" rel="nofollow">http://filthyrichclients.org</a> <br />Java: <a href="http://weblogs.java.net/blog/chet" target="_blank" rel="nofollow">http://weblogs.java.net/blog/chet</a> <br />Humor: <a href="http://chetchat.blogspot.com" target="_blank" rel="nofollow">http://chetchat.blogspot.com</a>
I've never won anything before. Not even a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|