Symbian
Symbian OS Library

FAQ-0812 Why does my paint() method not get called?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: AWT
Created: 08/23/2002 Modified: 09/18/2002
Number: FAQ-0812
Platform: Not Applicable

Question:
I have overridden the paint() method in my custom java.awt UI widgets but my code just seems to get ignored. What is going on?

Answer:
This is a limitation of the Symbian OS AWT implementation. Only so-called lightweight AWT components (where client code subclasses Component or Canvas) make use of the paint() method. Higher level components have native peer objects which are based on Symbian OS EIKON functionality. Their look and feel is predetermined by their definition in the native peer class code. So client code in an overridden paint() method is ignored.

    The one exception to this is java.awt.Button which in Symbian OS v7.0 was re-implemented so that calls to client paint() methods are picked up. This means that, for example, you can include a gif graphic as well as, or in addition to, text on your button.