How can I test if a reference is null ?

cudjoe cudjoe at europe.com
Thu Mar 27 10:40:50 EST 2003


On a Java GUI, I need to test if a label contains an Icon, I wrote
those few lines in Jython (similar):


tabComp = panel.getComponents()
trouve = false
for com in tabComp:
     if isinstance(com, JLabel):
          icon = com.getIcon()
          if( icon != NULL ): ##### doesn't work ! 
               trouve = true

I know that there are no types in python, but how can we test if a
variable is empty ?

Thanks you everybody,

Mathieu




More information about the Python-list mailing list