paint
paint(); (Form) paint(control: control-type input); (Control)
The paint event occurs when:
-
Part or all of a form or control is exposed after it has been moved or enlarged
-
A window that was covering the object has been moved
-
A visual aspect of the window has changed
Use a paint event if you need to coordinate the painting of a form or control with some external activity. The paint event is also invoked when the refresh and refreshNow methods are used. Using a refresh method in a resize event forces repainting of the entire object every time a user resizes the form.
The paint event is not called if the form or control has the autoRedraw property set to true or when running a Web-enabled JADE application, as no JADE forms are created and displayed.
Java generates a paint request for the smallest rectangle that encloses the required paint areas. GUI changes in a paint event therefore cause continuous painting if the resulting paint rectangle includes the same window again.
Using a paint event for certain tasks can cause a cascading event. In general, avoid using a paint event for the following.
-
Moving or sizing a form or control
-
Changing any variables that affect size or visual appearance, such as setting the backColor property for an object
-
Invoking a refresh or refreshNow method
-
Invoking the clearGraphics method
A resize event may be more appropriate for some of these tasks.
The paint event is called after the normal painting of the form or control has completed, allowing this image to be drawn on.
It is not possible to handle the painting of transparent controls in the correct zOrder when it involves a mixture of controls that can be directly painted by JADE and those that can only be painted separately by Windows.
As a result, transparent sibling controls are always painted before any JadeRichText, MultiMedia, JadeXamlControl, Ocx, OleControl, JadeDotNetVisualComponent, or ActiveXControl controls, regardless of their zOrder settings.