Bringing this answer to a private question back to the list. (I got
the wrong list the first time, oops).
----- Forwarded message from D-Man <dsh8290@...> -----
From: D-Man <dsh8290@...>
Date: Mon, 26 Mar 2001 15:19:29 -0500
To: cindy <infotechsys@...>
Mail-Followup-To: cindy <infotechsys@...>, tutor@...
The following works for me.
>>> import javax
>>> class Foo( javax.swing.JFrame ) :
... def __init__( self , title ) :
... javax.swing.JFrame.__init__( self , title )
... self.setVisible( 1 )
>>> frame = Foo( "Hello World" )
It doesn't matter what module you instantiate the class from. One thing to point out -- if you change the widget (is call setTitle or something) after it is visible, it won't be updated unless you call repaint().
Send your code (to the list) and we'll see what isn't right with it.
On Tue, Mar 27, 2001 at 02:47:10AM -0500, cindy wrote:
| Thanks for the reply. I like to change the scenario a bit beacuse I
| can't get the title
| to show in the title bar.
| I have a module name Foo.py and it inherit JFrame thus, class
| The init in Foo looks like this def__init__(self, title).
| In another module Bar.py I do a composit on Foo thus, self.aFoo =
| The title doesn't show. When I try to put a constructor in Foo, -
| swing.JFrame__init__(self, title),
| I get an error tell me that there is a constructor already.
| These are small example I could send you if you like.
----- End forwarded message -----