The name of this question is read xml and set txtfields using combobox
Hello and Thank you in advance for any assistance.
System info:
netbeans,glassfish,MySQL
The Purpose of this post is:
I am trying to learn how to read an entire XML file and create an array that the selected index from a combo box will populate text Fields using the index to find the appropriate data.
The functionality of this code is:
I presently have a program that uses a combo box, a switch, and text fields set Text code to populate text fields according to the selected Item (the text) from a combo box.
My task is to build an XML file from the hard coded data (hundreds of set text statements. I am in the process of this now and I believe the blocks of tags will be
Code description
pseudo xml
My question is:
Are there any standards for performing this operation?
Thanks again.
-ceyesumma
Note:
………………………………………………………………………………………………
Code description
James Howerton
Ranch Hand
Joined: Mar 14, 2009
Posts: 82
posted
0
On creating the xml I realized that I first need to read the entire xml and learn how to find the tag <name> and populate the combo
box.
Could someone help me get started with the proper class or syntax to be using?
I have the first block of XML created and there will be 14 more to follow and my combobox will need to be created and populated properly.
right now I use an array to populate the combo box and an itemStateChanged(ItemEvent box) method. to show a new selected Item
so I would like to know the proper procedure for loading a combo box from xml.
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
posted
0
Try looking at JAXP, that sounds appropriate for your case.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
The XmlFaq links to several introductory articles regarding XML processing in Java. Using the SAX API it's pretty easy to handle specific tags.
I looked at the documentation for an unrelated SAX program and I working on loading a combobox as mentioned above.
I can not seem to get all the pieces in order to just read the keycard.xml and print it out. I guess that is where I start but the example was very confusing. Is it possible to read the xml like this
error:
also my keycard.xml was only found when I put it on the C:/ drive how can I use the keycard.xml if it is in the program package?