|
-
Dec 10th, 2006, 01:28 PM
#1
Thread Starter
Lively Member
Updating the applet after changing a panel
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!
Code:
if (Jacques_Villeneuve != Number_One)
exit(1);
-
Dec 10th, 2006, 03:18 PM
#2
Frenzied Member
Re: Updating the applet after changing a panel
Anyone knows how to do this.
Why don't you?
Try setting the visiblity of the panels rather than removing and adding.
-
Dec 10th, 2006, 03:39 PM
#3
Thread Starter
Lively Member
Re: Updating the applet after changing a panel
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.
Code:
if (Jacques_Villeneuve != Number_One)
exit(1);
-
Dec 11th, 2006, 10:40 AM
#4
Thread Starter
Lively Member
Re: Updating the applet after changing a panel
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.
Code:
if (Jacques_Villeneuve != Number_One)
exit(1);
-
Dec 13th, 2006, 03:38 PM
#5
Lively Member
Re: Updating the applet after changing a panel
-
Dec 13th, 2006, 04:00 PM
#6
Frenzied Member
Re: Updating the applet after changing a panel
 Originally Posted by Sebouh
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.
-
Dec 15th, 2006, 02:21 AM
#7
Thread Starter
Lively Member
Re: Updating the applet after changing a panel
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.
Code:
if (Jacques_Villeneuve != Number_One)
exit(1);
-
Dec 15th, 2006, 06:07 AM
#8
Frenzied Member
Re: Updating the applet after changing a panel
For security reasons you'll have to sign the applet or go a different route.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|