Click to See Complete Forum and Search --> : Updating the applet after changing a panel
Sebouh
Dec 10th, 2006, 12:28 PM
Hi. In my program, i have a panel inside an applet.
There are several panels i'd like to load according to the pressed button. These panels will be loaded at the center of the applet.
When i press a button i'd like the previous panel to be closed and the new one opened.
A panel is loaded at first inside init();
Then i'd like to press a button and replace this panel with another one. How can i do this? It's like i need to remove the old panel using remove() then do add for the new one and repaint. But this is not working.
I tried many approches but they didn't work...
Anyone knows how to do this.
Thanks alot for the help!
System_Error
Dec 10th, 2006, 02:18 PM
Anyone knows how to do this.
Why don't you?
Try setting the visiblity of the panels rather than removing and adding.
Sebouh
Dec 10th, 2006, 02:39 PM
Damn, that's easy!
I thought when i set the other ones invisible, their location would still be visible, meaning they visible one would not be in the center.
I was caught up in the complexity, i forgot the simple thing.
thanks alot anyway, you saved me from future time wasting for nothing.
Sebouh
Dec 11th, 2006, 09:40 AM
I spoke too soon. It's not working well, it looks ugly.
The applet has a border layout, i insert the different panels in a panelA where this panel goes in the center of the applet. When i set the first panel invisible in panelA, the otehr panel stays on the right with a blank on its left.
This is pretty ugly.
vagabon
Dec 13th, 2006, 02:38 PM
this.validate();
System_Error
Dec 13th, 2006, 03:00 PM
I spoke too soon. It's not working well, it looks ugly.
The applet has a border layout, i insert the different panels in a panelA where this panel goes in the center of the applet. When i set the first panel invisible in panelA, the otehr panel stays on the right with a blank on its left.
This is pretty ugly.
call a refresh.
Sebouh
Dec 15th, 2006, 01:21 AM
Hmm, not sure, i think i did call refresh in one of my trials.
But it's no problem anymore...i've decided to go with a tabbed pane.
But i have another question. Since it's related i don't wanna open another topic. I want to write to a file from this applet. But it will give a restriction when it's on IE. I think there is somethink related to .jar tht i can do to be able to write. Do you have any idea about this? I think i'm supposed to put my class files in a jar file. Would this work? I don't know much about databases yet so i'm not gonna use a database management system to read/write.
System_Error
Dec 15th, 2006, 05:07 AM
For security reasons you'll have to sign the applet or go a different route.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.