The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by mel]

Can you provide me with information regarding the "swing.test" method
you use in the in the example on page 282ff? I'm having trouble
finding documentation on this Swing function. Thanks.
import-bot (20211) [Avatar] Offline
#2
Re: swing.test
[Originally posted by daryl harms]

> Can you provide me with information regarding the "swing.test" method
> you use in the in the example on page 282ff? I'm having trouble
> finding documentation on this Swing function. Thanks.

Hi Michael,

The reason you can't find any info on it in the Java Swing documentation is
that "test" is actually a short jpython function that can be found in the
file:

Lib/pawt/swing.py

It determines a default size, places the panel into a frame (add, pack) with
the name "Swing Tester" and fires it up (setvisible). It can also be given
size and name arguments to override the defaults. For example, here we could
have instead used something like:
swing.test(panel, size=(175,200), name='Calculator')

The pawt.test used in the previous example(note "p" here should be lowercase)
is a similar jpython function that can be found in:

Lib/pawt/__init__.py

Daryl