get the value of the position of this JPanel inside the JFrame
1 réponse
Frédéric Colombero
Hi Thomas,
What's the problem ?
I don't understand what you mean.
I have a JFrame and inside two JPanel one of them is on NORTH and the second
one is on the SOUTH.
And When I get the Container which is the JPanel (please see code below), I
would like to know if this one is in the north on the JFrame
or in the SOUTH or in the EAST, WEST or CENTER.
I would to know how to get the value of the position of this JPanel inside
the JFrame.
That 's all.
If you can helpme about this it will be very great.
Thanks a lot
Best regards
Frederic.
if (c instanceof JPanel){
String panel = "panel"+compPanel;
parentPanel = panel;
String allocPanel = ((Container)c).getClass().getName()+" "+panel+"= new
"+((Container)c).getClass().getName()+"();";
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Patrick Ruzand
Salut,
"Frédéric Colombero" wrote in message news:boa8r5$9ts$
Hi Thomas, What's the problem ? I don't understand what you mean. I have a JFrame and inside two JPanel one of them is on NORTH and the second
one is on the SOUTH. And When I get the Container which is the JPanel (please see code below), I
would like to know if this one is in the north on the JFrame or in the SOUTH or in the EAST, WEST or CENTER. I would to know how to get the value of the position of this JPanel inside the JFrame. That 's all.
Maitrises-tu toi-meme l'addition des composants ? Si oui, une solution serait de mettre en clientProperty de tes panel la contrainte du layout lors de l'ajout du JPanel dans la JFrame. Ensuite, dans le code ci-dessous, tu peux recuperer cette clientProperty pour savoir la position du panel.
-- Patrick
Salut,
"Frédéric Colombero" <colombero@aonix.fr> wrote in message
news:boa8r5$9ts$1@s1.read.news.oleane.net...
Hi Thomas,
What's the problem ?
I don't understand what you mean.
I have a JFrame and inside two JPanel one of them is on NORTH and the
second
one is on the SOUTH.
And When I get the Container which is the JPanel (please see code below),
I
would like to know if this one is in the north on the JFrame
or in the SOUTH or in the EAST, WEST or CENTER.
I would to know how to get the value of the position of this JPanel inside
the JFrame.
That 's all.
Maitrises-tu toi-meme l'addition des composants ? Si oui, une solution
serait
de mettre en clientProperty de tes panel la contrainte du layout lors
de l'ajout du JPanel dans la JFrame. Ensuite, dans le code ci-dessous, tu
peux
recuperer cette clientProperty pour savoir la position du panel.
"Frédéric Colombero" wrote in message news:boa8r5$9ts$
Hi Thomas, What's the problem ? I don't understand what you mean. I have a JFrame and inside two JPanel one of them is on NORTH and the second
one is on the SOUTH. And When I get the Container which is the JPanel (please see code below), I
would like to know if this one is in the north on the JFrame or in the SOUTH or in the EAST, WEST or CENTER. I would to know how to get the value of the position of this JPanel inside the JFrame. That 's all.
Maitrises-tu toi-meme l'addition des composants ? Si oui, une solution serait de mettre en clientProperty de tes panel la contrainte du layout lors de l'ajout du JPanel dans la JFrame. Ensuite, dans le code ci-dessous, tu peux recuperer cette clientProperty pour savoir la position du panel.