problem with Panel in an applet

  • Thread starter Christian \Raistlin\ Gulich
  • Start date
C

Christian \Raistlin\ Gulich

Hallo,

I'm having the following problem. I have a large, complex Panel, which
is stored in another panel. The information shown by my applet changes
when user interacts, so I have to actualize my panels. I do that in this way
containerpanel.removeAll();
complexpanel.setNewData();
containerpanel.add (complexpanel);
containerpanel.add (some_other_little_components);
containerpanel.validate();
The first time, I run this in my browser, the third line takes about a
half second. The next times, when I have to actualize the panel, it
takes about 5-6 seconds.
If I test it in the JBuilder-Applet-Testbed the problem doesn't occur.
Also, if I try to create an application instead of an applet.
The problem occurs in Firefox 0.9.3 as well as in IE6, both with the
1.4.2_01 JRE.

Could any body help?

Thanks, Christian
 
A

Andrew Thompson

I'm having the following problem. I have a large, complex Panel, which
is stored in another panel. The information shown by my applet changes
when user interacts, so I have to actualize my panels.

Hold up a second. Does the layout and mix
of components change, or just the textual
aspects of those components.

How many different forms of components
do you actually require?
I do that in this way
containerpanel.removeAll();
complexpanel.setNewData();
...
It is hard to say based on snippets, but if your panels
contain buttons that are hooked into listensers, you
need to detach them in order to free the references.
There are other sources of potential referenre to GUI
components that must be disconnected before thay are
marked for deletion by the garbage collector.
The first time, I run this in my browser,

Browser, this is an applet? URL?

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
C

Christian \Raistlin\ Gulich

Andrew said:
Hold up a second. Does the layout and mix
of components change, or just the textual
aspects of those components.

The layout and mix of components change, too.
How many different forms of components
do you actually require?

I use many Objects of Canvas, Label and Button in my complex Panel.
..
It is hard to say based on snippets, but if your panels
contain buttons that are hooked into listensers, you
need to detach them in order to free the references.
There are other sources of potential referenre to GUI
components that must be disconnected before thay are
marked for deletion by the garbage collector.

I tried to remove the listeners (using removeActionListener) from the
buttons before the call of removeAll() but the behaviour doesn't change.
Is there anything else, I should do?
Browser, this is an applet? URL?

URL is a bit difficult. The applet is the client part of a client server
architecture and the server isn't reachable to the public.

Thanks, Christian
 
A

Andrew Thompson

Andrew Thompson schrieb: (C.R.G.)
...
Is there anything else, I should do?


URL is a bit difficult. The applet is the client part of a client server
architecture and the server isn't reachable to the public.

The only other thing I can suggeest is preparing a
SHORT example that demonstrates the problem..
<http://www.physci.org/codes/sscce.jsp>

...and please read that carefully before you come
back and whine plaintively about your complex panels
and server, etc.. Try creating a two relatively simple
panels and swapping between them 1000 time etc.

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top