Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

display.set/getComponent()

Hi all,

If I have different displays which appear at different times at the same
Panel in my app, what's the better way to to this with regard to
performance and memory issues:

1) Panel.add(display[0].getComponent());
   // Do some stuff
   Panel.remove(display[0].getComponent());
   Panel.add(display[1].getComponent());

2) JPanel displayPanel = new JPanel();
   Panel.add(displayPanel);
   // Do some stuff
   display[0].setComponent(displayPanel);
   // Do some stuff
   display[1].setComponent(displayPanel);

What exactly does the setComponent()?

Thanks in advance, Mathias


------------------------------------------------------------
Mathias Stümpert
email: mathias@xxxxxxxxxxxx
homepage: www.stuempert.de



 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690