Results 1 to 3 of 3
Thread: Container - getParent
- 04-17-2012, 03:43 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 1
- Rep Power
- 0
Container - getParent
Hi.
First of all sorry for my english but i hope u can understand me!
i have a frame with 3 JPanels and 2 JButtons, the first panel have the other 2 panels and each of theese 2 panel has 1 button.
i made my own Actionlistener in another class.
What i want is if i click on a button i want the other button to be removed...( i know it would be so easy if i just use 1 class but i dont want this way)
I use getParent method to reach the frame so i can get the other panel wich have the button i want to remove.
How do i know how many times i can use getParent method?(if i dont know how many container exists above that button).
And another strange thing for me, i have just those 2 panels above my button but i can use getParent() 5 times and there are 3 more container why?:
class javax.swing.JPanel /i made it
class javax.swing.JPanel /i made it
class javax.swing.JLayeredPane /dunno what it is
class javax.swing.JRootPane /dunno what it is
class graphical.Surface /i guess its the frame
thx for ur help
- 04-17-2012, 04:04 PM #2
Re: Container - getParent
You are looking at how the java classes work internally. Some of the API will describe that. Also you could read the source for the classes you are using t see what they do.
If you don't understand my response, don't ignore it, ask a question.
- 04-17-2012, 05:01 PM #3
Similar Threads
-
j2me container app
By AfricanEinstein in forum CLDC and MIDPReplies: 0Last Post: 01-21-2011, 08:02 PM -
Help with adding a Container within a Container
By JoKeR313 in forum New To JavaReplies: 4Last Post: 01-02-2011, 04:59 AM -
Applet as container .
By pawankumarom in forum Java AppletsReplies: 5Last Post: 04-23-2009, 06:17 AM -
[SOLVED] Coordinates container --> in parent container.
By Cleite in forum AWT / SwingReplies: 3Last Post: 04-21-2009, 11:01 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks