I am seeing some weird behavior in repaint(); My code displays png or jpg icons in a JLayeredPane over the top of a background image after querying a set of switches on an embedded computer over ethernet. The response time of the repaint(); method seems to become slower as the program runs. The problem seems to be more pronounced when I use PNGs with transparency. If I dump the raw data from the incoming packet to the screen into a JLabel, it seems to maintain its speed as long as the program runs. Has anyone ever experienced this? I have pored over the internet and exhausted the Java books that I currently own and seem to have come up dry.
These are the parts of the code where I think the problem might be:
I created a MyDipswitchDraw object called dipSwitchDraw and access it from this method. dipSwitchData is the position of the data in the incoming packet that I am operating on. I am also using this method to report how long it takes to complete. It seems to report around 50000nS when only the command line is displayed, but over time while the Java GUI is displayed, as the switches are actuated, the delay time increases from 50000ns to over 2000000nS