Getting data from the database to insert into a JTree

How do i get data from the database and insert it into the JTree? It would be nice if u could write the code. Thanks in advance!
[128 byte] By [kirtipriyanka] at [2007-11-20 11:54:24]
# 1 Re: Getting data from the database to insert into a JTree
It would be nice if u could write the code.

It would be nice if you dropped out of all your comp-sci classes so that you dont ever write a program that I might one day have to use.
Martin O at 2007-11-10 2:14:00 >
# 2 Re: Getting data from the database to insert into a JTree
Sorry I just read one too many posts from college kids making NO attempt to learn how to program.

I'd suggest first writing a little program to get data from a database.
Then write a little program to put values in a JTree.
Then put what you've learned together into 1 program.

To learn about how to do the first 2 things, read this:
http://java.sun.com/docs/books/tutorial/reallybigindex.html
Martin O at 2007-11-10 2:14:57 >
# 3 Re: Getting data from the database to insert into a JTree
If you looked at the Tree tutorial, you'd see that their first example adds 'BookInfo' objects to DefaultMutableTreeNode. In your case, instead of a BookInfo object, add a String object.
Martin O at 2007-11-10 2:15:56 >
# 4 Re: Getting data from the database to insert into a JTree
i tried doing that but it is still not working.
kirtipriyanka at 2007-11-10 2:16:56 >
# 5 Re: Getting data from the database to insert into a JTree
I don't think anyone is going to read that huge chunk of unformatted code. When posting code to the forum, use the [CODE]..[/CODE] tags. If you don't know what they are, read the forum posting guidelines.

Programs must be written for people to read, and only incidentally for machines to execute...
H. Abelson & G. Sussman
dlorde at 2007-11-10 2:17:55 >
# 6 Re: Getting data from the database to insert into a JTree
thanx for the suggestion!
kirtipriyanka at 2007-11-10 2:18:56 >