posted 19 years ago
hi frenz... i have a problem regarding JTree and JToolBar... what i m doing is..when my application starts i m making a GUI which contains a panel which shows a JTree and JMenu and JToolBar. JTree is constructed from nodes which is constructed from fields from database.. thus the nodes(objects) are created when applications starts. in the JToolBar and JMenuBar, I m using actions to which I m sending this JTree as parameter. these actions are using this JTree to perform Operations. these operations include adding Nodes to JTree. I m able to do that..i.e. adding nodes to JTree model and Database and the node is successfully added in JTree but the problem is after adding or deleting the nodes when I check for the parents , they contain same elements as when the application started.. when I restart the application all the data is again fetched from database and JTree is constructed. The problem is obvious that i passed the JTree, which i constructed when the application started, as argument and it is still working on that.. what i want is that whenever any change occurs in JTree i.e adding or deleting , changes should be applicable from that very moment.. I m troubled by this.. plz help with detailed and clear example.
thanx in advance
Sandeep
[ September 16, 2005: Message edited by: Michael Ernest ]