From: Bill K. <bi...@ct...> - 2001-09-05 16:28:14
|
Hi, I'm writing Swing code and need to provide my own paintComponent() method, which is required to invoke super.paintComponent() in most cases (see http://java.sun.com/docs/books/tutorial/uiswing/converting/generaltips.html "Converting Painting Code") - but paintComponent() is a protected method of JComponent, and I'm unable to invoke it from my jython paintComponent method. I see in the jython docs on subclassing: Calling Methods in Your Superclass In Python, if I want to call the foo method in my superclass, I use the form: SuperClass.foo(self) This works with the majority of methods, but protected methods cannot be called from subclasses in this way. Instead you have to use the "self.super_foo()" call style. Could someone post an example of this call style? I've tried a couple things: self.super_paintComponent() and self.JPanel_paintComponent() but no luck with either. (JPanel being my direct superclass.) Thanks for your help, Bill |