Java's repainting
system can be pretty mystifying at times. But in this case the behavior SHOULD*
be straightforward.
Swing should* detect
when your JDialog has been closed, and the RepaintManager should* automatically
call your
component's paint()
method (with the correct clipping region). Unless you override paint() it should
call paintComponent().
Of course from your
explanation, for some reason you are not getting repainted. Check if your
paintComponent()
method is actually
being called at this point -- if so, check the clipping region on the Graphics
argument.
It might also be
helpful to know what platform you are working with -- even though Java should*
work on all platforms,
the behavior is not
guaranteed to be consistent, especially with something as OS-driven as
windowing/repaints.
Mike
* - not a
guarantee
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".-----Original Message-----
From: Discussion list for Java 2D API [mailto:[EMAIL PROTECTED]On Behalf Of Walter H Shirey
Sent: Friday, February 06, 2004 1:42 PM
To: [EMAIL PROTECTED]
Subject: [JAVA2D] repainting JPanelI'm having problems trying to figure out how to redraw a JPanel with custom graphics after a JDialog, displayed on top of the JPanel, has been disposed of. Also having the same problem when the window has lost focus or been maximized after being minimized to toolbar.If I overwrite the paintComponent() method of the JPanel, will Java know to paint the JPanel after the JDialog has been disposed, or if focus has returned to the window? Or do I have to implement focusListeners with the paintComponent() method?Thanks in advance,Walter Shirey=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
