From: Jeff E. <jem...@fr...> - 2005-05-19 15:22:43
|
>frame.contentPane().add(table) This should be either frame.contentPane.add(table) or frame.getContentPane().add(table) The first uses the jython bean property mechanism. ytc...@ya... wrote: > Reading through the book "Python Programming with the Java Class Libraries" I entered the code on page 417 and got the following results. What might be causing the error? > > >>>>from javax.swing import JFrame, JTable >>>>frame = JFrame('this is a table test') >>>>table = JTable(4,4) >>>>frame.contentPane().add(table) > > Traceback (innermost last): > File "(console)", line 1, in ? > AttributeError: instance of 'javax.swing.JPanel' has no attribute '__call__' > > > > |