MY Jtree component is created within a actionperformed function. But I've already created a Jscrollpane in the constructor and added it to the JFrame.
Now within the actionperformed function, I tried to add the dynamically created JTree to the JScrollpane using
JScrollpaneobject.add(JtreeObject);
JScrollpaneobject.revalidate();
But I am unable to see the Jtree on the Jscrollpane.
direct variant of the same:
scroll.setViewportView(jTree)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With