Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
You need to implment "TreeExpansionListener" and register your Jtree.
TreeExpansionListener implementation:
public class
YourOwnTreeExpansionListener implements
TreeExpansionListener{
public void treeCollapsed(TreeExpansionEvent
te){
for(int i=0;
i<expandedNodes.size(); i++){
if(equalPath((TreePath)expandedNodes.get(i),te.getPath())){
expandedNodes.remove(i);
}
}
}
public void treeExpanded(TreeExpansionEvent
te){
if(te.getPath().getPathCount()>1){
boolean has=false;
for(int i=0; i<expandedNodes.size(); i++){
if(equalPath((TreePath)expandedNodes.get(i),te.getPath())){
has=true;
break;
}
}
if(!has){
expandedNodes.add(te.getPath());
}
}
}
}
JTree
:
public class YourOwnTree extends
JTree {
public
YourOwnTree(YourController rc) {
this.rc = rc;
this.setEditSets(rc.getEditSets());
this.addTreeExpansionListener(yourOwnTreeExpansionListener);
}
}
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.