• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree refresh problem

 
sandeep kumar jangra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
sandeep kumar jangra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry gregg... i too want people to answer my question when they have time.
but atleast i can request... that was a request...anyhow I wont be using dat word. but plz go through my problem and answer
thanx
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a certain irritation factor at reading through posts and seeing many of them marked "urgent.' I've edited that portion out of the topic title as a courtesy to all readers.

You might also format your request so that it is easier to read. If a post looks like a long, solid block of text -- especially one full of shorthand spellings -- most people will pass over it.

Regards,
 
sandeep kumar jangra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx everybody for making me learn the way to post topic. plz bear with newbies

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
1) JTree
2) JMenu
3) JToolBar.

JTree is constructed from nodes which is constructed from fields from database.. thus the nodes(objects) are created when applications starts.
(by connecting to database).

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 view 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 parameter.. 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!