Results 1 to 8 of 8

Thread: Updating the applet after changing a panel

  1. #1

    Thread Starter
    Lively Member Sebouh's Avatar
    Join Date
    Jan 2005
    Posts
    73

    Exclamation 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);

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    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.

  3. #3

    Thread Starter
    Lively Member Sebouh's Avatar
    Join Date
    Jan 2005
    Posts
    73

    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);

  4. #4

    Thread Starter
    Lively Member Sebouh's Avatar
    Join Date
    Jan 2005
    Posts
    73

    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);

  5. #5
    Lively Member
    Join Date
    Oct 2005
    Posts
    74

    Re: Updating the applet after changing a panel

    this.validate();

  6. #6
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Updating the applet after changing a panel

    Quote 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.

  7. #7

    Thread Starter
    Lively Member Sebouh's Avatar
    Join Date
    Jan 2005
    Posts
    73

    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);

  8. #8
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    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
  •  



Click Here to Expand Forum to Full Width