Delete a panel inside a panel

Discussion in 'Java' started by HS1, Dec 7, 2004.

  1. HS1

    HS1 Guest

    Hello all

    I have some sub-panels inside a main panel. The main panel is
    VerticalFlowLayout. Inside each subpanel, I have button "Delete". What I
    want is that when I click the "Delete" in a panel, this sub-panel will be
    disposed and the main panel will be updated.
    I do not want to have a variable main panel for each sub-panel as it is not
    a good design
    Is there a good way to do this. Do I have to create event handlers????

    Thank you for your help
    SH1
     
    HS1, Dec 7, 2004
    #1
    1. Advertising

  2. > I have some sub-panels inside a main panel. The main panel is
    > VerticalFlowLayout. Inside each subpanel, I have button "Delete". What I
    > want is that when I click the "Delete" in a panel, this sub-panel will be
    > disposed and the main panel will be updated.
    > I do not want to have a variable main panel for each sub-panel as it is

    not
    > a good design


    Why is it not a good design ? I think it is reasonable for an object to have
    a reference to whatever it is going to work on.

    Niels Dybdahl
     
    Niels Dybdahl, Dec 7, 2004
    #2
    1. Advertising

  3. HS1 wrote:
    > Hello all
    >
    > I have some sub-panels inside a main panel. The main panel is
    > VerticalFlowLayout. Inside each subpanel, I have button "Delete". What I
    > want is that when I click the "Delete" in a panel, this sub-panel will be
    > disposed and the main panel will be updated.
    > I do not want to have a variable main panel for each sub-panel as it is not
    > a good design
    > Is there a good way to do this. Do I have to create event handlers????
    >


    If the subpanel is directly added to the main panel, calling getParent()
    on the subpanel should give you a reference to it.

    BK
     
    Babu Kalakrishnan, Dec 7, 2004
    #3
  4. HS1

    HS1 Guest

    Thank you
    That is what I want
    SH1
    "Babu Kalakrishnan" <> wrote in message
    news:...
    > HS1 wrote:
    > > Hello all
    > >
    > > I have some sub-panels inside a main panel. The main panel is
    > > VerticalFlowLayout. Inside each subpanel, I have button "Delete". What I
    > > want is that when I click the "Delete" in a panel, this sub-panel will

    be
    > > disposed and the main panel will be updated.
    > > I do not want to have a variable main panel for each sub-panel as it is

    not
    > > a good design
    > > Is there a good way to do this. Do I have to create event handlers????
    > >

    >
    > If the subpanel is directly added to the main panel, calling getParent()
    > on the subpanel should give you a reference to it.
    >
    > BK
     
    HS1, Dec 7, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    3
    Views:
    553
    Harry Singh
    Nov 10, 2003
  2. HS1
    Replies:
    4
    Views:
    8,305
    Babu Kalakrishnan
    Dec 8, 2004
  3. JC
    Replies:
    1
    Views:
    751
    Michael Rauscher
    Aug 9, 2006
  4. Ulf Meinhardt
    Replies:
    0
    Views:
    622
    Ulf Meinhardt
    Jul 7, 2009
  5. Robin Wenger
    Replies:
    0
    Views:
    2,942
    Robin Wenger
    Aug 18, 2011
Loading...

Share This Page