LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-05-2004, 05:36 AM   #1
decadent
LQ Newbie
 
Registered: Mar 2004
Posts: 5

Rep: Reputation: 0
Java: JTree & drag'n'drop


Code:
DefaultMutableTreeNode dmtn = new DefaultMutableTreeNode("root");

DefaultMutableTreeNode child = new DefaultMutableTreeNode("leaf1");
dmtn.add(child); 

child = new DefaultMutableTreeNode("leaf2");
dmtn.add(child); 

child = new DefaultMutableTreeNode("leaf3");
dmtn.add(child); 

mymodel = new DefaultTreeModel(dmtn); 
mytree = new JTree(mymodel);
How to realize drag'n'drop for tree leafs?
Please, write code, if it is not difficult for you.
 
Old 06-07-2004, 06:41 AM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
This book has an example of what you want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with JTree. Diederick Programming 1 06-17-2005 07:16 PM
Jtree can only modify one? ::JAVA:: logicdisaster Programming 0 09-27-2004 12:40 PM
How do i refresh a jtree? logicdisaster Programming 1 09-23-2004 03:33 PM
Java: Some questions about JTree decadent Programming 1 04-01-2004 05:32 AM
Can't drag'n'drop a file from Nautilus to Mozilla miguelmmg Slackware 0 11-25-2003 11:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration