finding source of paint events

Hi,

I've inherited maintaining an application written by someone who no longer works for the company. While debugging a custom component, I've noticed that there is a stead stream of events causing constant screen redraws.Here's a stack trace printed from inside of my custom component's paintComponent method during one such redraw. The execution stack is always the same.

at mms.dle.ui.util.Watermark.paintComponent(Watermark.java:46)

at javax.swing.JComponent.paint(JComponent.java:808)

at javax.swing.JComponent.paintChildren(JComponent.java:647)

at javax.swing.JComponent.paint(JComponent.java:817)

at javax.swing.JLayeredPane.paint(JLayeredPane.java:557)

at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4787)

at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4740)

at javax.swing.JComponent._paintImmediately(JComponent.java:4685)

at javax.swing.JComponent.paintImmediately(JComponent.java:4488)

at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)

at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run

(SystemEventQueueUtilities.java:117)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:189)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:478)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy

(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForHierarchy

(EventDispatchThread.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Looks like something is throwing update events into the queue, but I have absolutely no ideas how to find what it is. Any thoughts?

Thanks

d.

[1924 byte] By [dberanskya] at [2007-10-3 9:49:25]
# 1
I can recall a post dealing with constant redraws, and it was all about a JList with rendered components - clicking on a list item triggered 100's of repaintsit was weird, unfortunately can't remember the solution (or if there was one).
Michael_Dunna at 2007-7-15 5:06:28 > top of Java-index,Desktop,Core GUI APIs...
# 2
i'm not as much looking for a solution, as to possible ways to debug it. The UI is relatively simple. It's a pane in CardLayout with some static text and two text fields.
dberanskya at 2007-7-15 5:06:28 > top of Java-index,Desktop,Core GUI APIs...
# 3
Can you create a Short,Self Contained, Compilable and Executable, Example Program
zadoka at 2007-7-15 5:06:28 > top of Java-index,Desktop,Core GUI APIs...
# 4
no, i can't. If I could, that would've implied that I understood where the problem was coming from.again, I'm NOT asking what's wrong with my program. What am I asking, is: given these symptoms, how would I go about diagnosing the problem.
dberanskya at 2007-7-15 5:06:28 > top of Java-index,Desktop,Core GUI APIs...
# 5

> What am I asking, is: given these symptoms, how

> would I go about diagnosing the problem.

I would create a simple example program. This would allow me to isolate everything down to the core issue. Then when I was down to just a few lines of code it would be clear what the problem was.

zadoka at 2007-7-15 5:06:28 > top of Java-index,Desktop,Core GUI APIs...