A process and system for blocking unnecessary callbacks to empty paint
methods of graphical user interface components is provided. The process
initializes a platform-dependent peer class corresponding to a
platform-independent class for the graphical user interface component and
stores a value representing whether the platform-independent class extends
a standard platform-independent class for the graphical user interface
component. A platform-dependent paint method determines whether a callback
to a paint method is necessary for processing of the paint event. The
callback determination is performed by checking the stored value
representing the extension of the standard graphics class for the
component. If a callback is necessary, then the native paint method
initiates a callback to the paint method of the platform-dependent peer
object. The native paint method may be implemented in the C++ programming
language, and the platform-dependent peer class and the
platform-independent class may be implemented in the Java programming
language.