質問

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.

役に立ちましたか?

解決

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

他のヒント

You can add logging to your application. Consider using LogBack

Interesting discussion here about logging for Swing applications as well.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top