Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

adding one Jpanel to another  RSS feed

 
vasu kasukurthi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code in my tool, that adds one jpanel to another.
when ever i start tool jpanLinks panel is added to jpAvailable panel , but i made changes to jpanLinks and calling the same method which adds that panel to rootpanl it is showing same panel what it contain previosly.

Before and after following line are excuting correctly but this line is skipping,

jpAvailable.add(objLinkTree.jpanLinks);



Any one can help me to solve this issue.


AvailableTree class{
..........
...........
method(){
JPanel jpanLinks = new JPanel();
public JTree jtre = new JTree(root);
public JScrollPane jscrl = new JScrollPane(jtre);
jpanLinks.add(jscrl, new GridLayout(1,1));
}
-----------
.......
}
panelEditor{
......
...
JPanel jpAvailable = new JPanel();
.......
....
method1(){
.................
.................
jpAvailable.add(objLinkTree.jpanLinks);
......................
................
}


}
Thanks in advance

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try validating the panel. Something like this:


Edit: Btw Use Code Tags
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!