logo       

Re: Adding Table to Frame generates: 'javax.swing.JPanel' has no attribute: msg#00045

lang.jython.user

Subject: Re: Adding Table to Frame generates: 'javax.swing.JPanel' has no attribute '__call__'

>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.




ytcm47-jythonuserslist@xxxxxxxxx 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__'




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise