Calling PaintComponent in Jython

Luiz Felipe Martins fmartins at
Thu Aug 22 12:26:02 CEST 2002

I´m trying to do something like this:

class MyPanel(javax.swing.JPanel):
   def PaintComponent(self,g):

This does not work because PaintComponent is protected. In the book Jython
for Java Programmers (excellent, btw), R. Bill suggests either changing the
Jython registry or to write a Java class to mediate access.

I wonder if there are any other workarounds, or if the Jython folks are
planning changes in the way access to protected methods is handled?

Note: I know I can make my code work overriding paint instead of
PaintComponent, I just am curious to know how it can be done.

L. Felipe Martins
Department of Mathematics
Cleveland State University
fmartins at

More information about the Python-list mailing list