The MY Jtree component is created inside the function associated with the action. But I already created Jscrollpane in the constructor and added it to the JFrame.
Now in the function related to the action, I tried to add the dynamically created JTree to JScrollpane using
JScrollpaneobject.add(JtreeObject); JScrollpaneobject.revalidate();
But I can not see Jtree on Jscrollpane.
source share