This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm working on an applet that draws information from a text file for display in text fields for calculation. The trouble I'm having is this: The numbers are broken down by state. Then each state has 3 columns of figures (all of the same data type) broken down by type. There are 4 rows in each column. I don't know how to draw the data from the file into the applet and how to store it once it has been added. I figure I would use a stream to input the data but how do I tell the stream which state to draw from and which column within the state to display. What sort of data structure (array, Vector, hashtable) would I use and how do I write my file objects to it? I'm new to Java and this is the most complicated thing I've had to do. Any help would be most appreciated. Thank you in advance. ------------------
Jeff, I think you should provide more info so that people understand your problem better. It could be my english, but I didn't get your point with states and what the numbers were for. (United States or program states? ) Regards, Marius [This message has been edited by Marius Holm (edited January 22, 2001).]
Joined: Oct 05, 2000
I'm sure your English is fine. I was referring to U.S. states. The data I'm working with is the alcohol tax rate for individual U.S. states. The user will select his state from a Choice list, then three columns of TextFields will populate with the tax data for liquor, beer, and wine. Consumption rates for each type of alcohol will also be included. The data can be organized in a text file any way I see fit, but I don't know how to go about retrieving the right data and storing it for access by the applet. ------------------
Jeff, Here is the way I would do it... I would have the text file on the server (www.someserver.org/~jeff/liquor.txt) and either hardcode this into the applet or have it passed in as a parameter. (i.e. somehow it basically has to boil down to