| | |
Reading from a file to fill an array
![]() |
•
•
Join Date: Jul 2005
Posts: 6
Reputation:
Solved Threads: 0
Just wanted to give you all who offered some advice a little update. I never fully got this to work, but I did find some problems with the last thing I posted.
I changed the file that I was reading from to a .dat, cause one of my classmates suggested that our SDK (version 1.5, I think?) did not like .txt files. I do not know how true this is, have not managed to confirm or disprove this theory. I moved the file reading code out of the "MortCalc()" method, since that was not allowing the file read to occur until that method was called. I put it into the end of the MikesCalc() method. I put in a System.out.println temporarily, just to verify that both of my arrays were receiving the information. That part works. I also got rid of one of the array initializations under the class, and put it in the method that was using it.
I ran out of time for the assignment, so I had to turn it in as is. I still want to figure this out, though. Another person suggested that I was initializing one of my arrays in such a way that it was causing it to fill the JComboBox with an empty string. This may be the case, but I do not know how to fix it. If anyone is interested in providing a few more pointers, I will provide any info they want. Thanks for your time.
I changed the file that I was reading from to a .dat, cause one of my classmates suggested that our SDK (version 1.5, I think?) did not like .txt files. I do not know how true this is, have not managed to confirm or disprove this theory. I moved the file reading code out of the "MortCalc()" method, since that was not allowing the file read to occur until that method was called. I put it into the end of the MikesCalc() method. I put in a System.out.println temporarily, just to verify that both of my arrays were receiving the information. That part works. I also got rid of one of the array initializations under the class, and put it in the method that was using it.
I ran out of time for the assignment, so I had to turn it in as is. I still want to figure this out, though. Another person suggested that I was initializing one of my arrays in such a way that it was causing it to fill the JComboBox with an empty string. This may be the case, but I do not know how to fix it. If anyone is interested in providing a few more pointers, I will provide any info they want. Thanks for your time.
![]() |
Similar Threads
- RE: reading .wav file and putting ito inot the array (C)
- reading txt file into array (C++)
- URGENT - Reading from txt file into a 2 dimension array (Java)
Other Threads in the Java Forum
- Previous Thread: Java GUI JOptionPane.showMessageDialog
- Next Thread: A newbie needs help in Java ......
| Thread Tools | Search this Thread |
-xlint add android api applet application array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component converter database digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying page pearl print problem program programming project qt recursion scanner screen server set size sms sort sorting spamblocker sql sqlserver string superclass swing system thread threads tree variablebinding windows xor





