Delete a panel inside a panel

H

HS1

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
 
N

Niels Dybdahl

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
 
B

Babu Kalakrishnan

HS1 said:
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
 
H

HS1

Thank you
That is what I want
SH1
Babu Kalakrishnan said:
If the subpanel is directly added to the main panel, calling getParent()
on the subpanel should give you a reference to it.

BK
 

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,780
Messages
2,569,611
Members
45,274
Latest member
JessMcMast

Latest Threads

Top