add() in AWT, Panels to Panels to Panels, extremely, extremely slow.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jeff_Rancier
Posted On:   Tuesday, April 22, 2003 03:25 PM

I am porting a Swing Applet to AWT (the PDA's JVM doesn't support Swing). The top level container is an Applet. A Frame is created as the main container. To this, two Panels are created, one which manages a home grown menubar using popup menus, and another Panel which using the CardLayout. Adding multiple other Panels to the latter Panel (with CardLayout) is extremely, extremely slow. This is running on Windows, with a PIII, with over 300M of RAM. Is this due to the creation of all the peer Panel components? If so, is there a solution? Perhaps I created an Array of Panels upon initialization, and serve them up as I need them? Thanks in advance. Jeff    More>>

I am porting a Swing Applet to AWT (the PDA's JVM doesn't support Swing). The top level container is an Applet. A Frame is created as the main container. To this, two Panels are created, one which manages a home grown menubar using popup menus, and another Panel which using the CardLayout.



Adding multiple other Panels to the latter Panel (with CardLayout) is extremely, extremely slow. This is running on Windows, with a PIII, with over 300M of RAM.



Is this due to the creation of all the peer Panel components?



If so, is there a solution? Perhaps I created an Array of Panels upon initialization, and serve them up as I need them?



Thanks in advance.

Jeff


   <<Less

Re: add() in AWT, Panels to Panels to Panels, extremely, extremely slow.

Posted By:   Jeff_Rancier  
Posted On:   Thursday, April 24, 2003 08:43 AM

Well, after tearing out a bunch of code, and debugging, it *appears* to be slow due to the fact, that I create components, resize them, and then add them.



Creating them, adding them, and then resizing them sped up the add() method significantly. Is this standard AWT behaviour?



Jeff



About | Sitemap | Contact