Article View: borland.public.jbuilder.java.swing
Article #11159Naming DefaultMutableTreeNodes Using Data From Database
From: Musa S Marasi
Date: Fri, 02 Jul 1999 00:00
Date: Fri, 02 Jul 1999 00:00
32 lines
1585 bytes
1585 bytes
Dear TeamB
We are trying to create DefaultMutableTreeNodes inorder to populate a
jdbTree.
The data is coming from a database using a querydataset
The problem is this:
We have a column in our database "Code"
This column contains the name that we would like to specify as the name
of the node so that we may reference it in the future i.e. to add
children, not only what the node will display on the tree.
Our code looks like this :
public void createNodes(){
QueryDataSet tq = myDM.getQueryDataSet2();
tq.open();
tq.executeQuery();
tq.first();
int numberOfRows = tq.getRowCount();
int loopCount = 0;
for(loopCount = 0; loopCount < numberOfRows; loopCount ++) {
String codeName = tq.getString("Code");
DefaultMutableTreeNode ? = new DefaultMutableTreeNode("codeName");
tq.next();
}
}
we would like the name of the node to be placed where the "?" is to have
the same value as that is contained in the String codeName.
Thanking You In Advance
Shabber Abbas
Technical Details
Message-ID:
<377CD748.82A7654B@codetech.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,9eac39eb5058f6bb,start X-Google-Attributes: gid111d45,public From: Musa S Marasi <musa@codetech.com> Subject: Naming DefaultMutableTreeNodes Using Data From Database Date: 1999/07/02 Message-ID: <377CD748.82A7654B@codetech.com> X-Deja-AN: 496442102 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing