Question

I am trying to narrow down why my JComponent is not redrawing. It is odd in that I can get redraw to work on mouse press and release, but not on drag. Is there a way to print out the EventQueue or verify that the PaintEvent was carried out or dumped? Let me know, thanks.

Was it helpful?

Solution

There's no way to print out jobs on the EventQueue, at least not that I know of.

Are you sure you are calling repaint()? Please note that calling repaint does not guarentee that your component will be repainted immediately or in any timely manner.

My guess is that if you are calling repaint, the problem may be that you are never letting go of the UI thread. If you are waiting on the GUI thread and not releasing, your GUI will never refresh

OTHER TIPS

You can add logging to your application. Consider using LogBack

Interesting discussion here about logging for Swing applications as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top