arrays
Isit possible to store the grand totals of an order into an array? my program processes food orders and displays the grand total into a JTextArea, i want all of the grand totals generated to be saved into a file how would i do this using an array? i thought about adding some sort of listener to the JTextArea would this work?
[333 byte] By [
lozengera] at [2007-11-26 19:51:38]

That's kind of a run-on paragraph.
Let's summarize:
1. Arrays or collections can hold most anything you can dream of.
2. What is your goal? Is it to use an array or to save data to a file?
Realize that the second doesn't necessarily imply the first.
3. Getting numerical information from a JTextArea seems to be putting
the cart before the horse. How did the data get there? I think it will
make more sense to acquire the data directly and leave theJTextArea to its own devices.
Comments?
> yeh my goal is to store all of the grand totals into
> a file by using an array.
If you store all of the grand totals into a file without using an array,
will you have failed?
> the grand total is coming from my " double total sum"
> the total sum is what outputs the grand total into
> the JTextArea
You can get text from a text area simply by:
String text = theTextArea.getText();
but I still claim that there are easier and better ways to do it --
like get the data from whatever object put the results in the text area.