XML in Java
843834Oct 4 2006 — edited Oct 4 2006Hi 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