Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XML in Java

843834Oct 4 2006 — edited Oct 4 2006
Hi guys,

I'm a bit of a newbie when it comes to XML and Java. I'm writing a kind of till system for programming practice, and I have a query.

I want the data from a given XML file (called stock) to be displayed in a JTable when a certain button is clicked,

e.g if the user clicks on bread roll, then the table will have something like

Qty Item Description Price
=============================
1 Bread Roll �0.79

(This will be in Swing of course).

I was wondering what would be the best way to use the XML file in this way? I've written a DOM class which I intend to use to parse the document, but I was wondering would it be a good idea to load the thing into a Vector and then use the data from a Vector to be in the Table, or can I do it direct from the XML file?

emyr
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2006
Added on Oct 4 2006
2 comments
164 views