Swing and repainting

Hello,

I have a problem with repainting of a custom JPanel component. The problem is that the component isn't repainted in cases when user resize main window, switch between different windows or when user clicks in the JMenu's panel.

Is there any common issue that can fix this problem or i have to handle all events that may occur ?

Thanks in advance.

Message was edited by:

Matrix_N

[425 byte] By [Matrix_Na] at [2007-11-27 8:16:24]
# 1

> or i have to handle all events that may occur ?

Nope, you don't do anything. Swing determines what need to be repainted. You have a bug in your code.

If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", see http://homepage1.nifty.com/algafield/sscce.html, that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

Don't forget to use the "Code Formatting Tags", see http://forum.java.sun.com/help.jspa?sec=formatting, so the posted code retains its original formatting.

camickra at 2007-7-12 20:01:18 > top of Java-index,Desktop,Core GUI APIs...