We got a lot of questions and positiv feedback on our presentation and we are very thankful for that. There were also two persons who pointed out, what they believed was, mistakes/errors in our presentation. This post is about those errors.
First of all one person told us that when we draw our component in the paintComponent() method we must consider the space that the border will use. If the border uses five pixels on the edges then we cannot paint anything on those 5 pixels. Yes that’s understood and maybe we should have said it but our goal is to make the code, in the presentation, easy to understand and that’s why we didn’t include it.
Secondly someone told us that when we change the location of the component in the Kinetic Scrolling code we shouldn’t do it directly but instead do it later, probably by using SwingUtilities.invokeLater(). The reason was that every time we changed the location of the component events will be fired and the source of those events will be our KineticScrolling component. I don’t understand what’s wrong with that? I believe that the KineticScrolling component should be what caused the event and nothing else, At least as long as we are running on the EDT. I’m going to investigate this further and let you know what the right way is.
Recent comments