• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to copy/cut a selected node from Jtree

 
Priya M
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello sir/Madam,
I've created Jtree for the application .Please help me how to copy/cut a selected node from Jtree
Thanks in adv,
 
Swamy Vatti
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you explain in detail.
Cut a node and copy into the same JTree? or copy the contents into another component.
 
Priya M
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello swamy,
Thank U for the Response.
Using a JTree Component I've created a Explorer,where I want to copy/cut a some file/folder and add to some directory in this I am trying to implement copy/cut concepts.
Thanks
 
Swamy Vatti
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a key listener both to the tree and the other component(lets say table) where you select the files. when you press ctrl+c on the table, copy the path to the System clip board and when you press ctrl+v on the tree node, copy the file to the current directory.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Priya M",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!