read 6 « Operation « Java I/O Q&A





1. Reading file atributes in java??    java-forums.org

Hi, I've been given an assignment to write a client/server program where the client sends the name of a file to the server and the server replies with the file attributes(size, permissions etc.) I've written the client and server already but cant find how to get the files attributes. This will only be run on linux if that helps. Any idea ...

2. reading a file    java-forums.org

I disagree in this case. OP has said he intends to make sure the Exceptions don't happen in the first place, so if they do, a stack trace and abort seems as good as anything. I think in general, unless you know exactly what you want to do with an Exception (such as prompt for another file name) you should leave ...

3. read file    java-forums.org

public void readSura() { sNumber = jComboBox1.getSelectedIndex(); jTextArea1.setText(null); System.out.print(sNumber); file = new File("qu/" + sNumber); try { input = new Scanner(file); } catch (FileNotFoundException ex) { JOptionPane.showMessageDialog(null, "can't fine file", "error", JOptionPane.ERROR_MESSAGE); } while (input.hasNextLine() && noOfLines < 10) { //read first 10 lines fro file String outPut = input.nextLine(); jTextArea1.append(outPut+"\n\n"); ++ noOfLines; } input.close(); }

4. File Reading    java-forums.org

5. Read two matrices from file    java-forums.org

Hello to everybody. I ve got a txt file, for instance 4x4 and i want to two matrices 4x2. I know how to read variables from a file. Have you any idea how can I do it for the matrices?? My code is this: Java Code: public void OpenFileRead(String fileName) { //anoigma tou arxeiou gia diavasma try { input = new ...

6. Reading from File    java-forums.org

Hey everyone! :) I am trying to program a brief text adventure just for getting used to Java. Now what I want to do is: I've got large quantities of text outputs (descriptions, dialogues and so on), so I don't want to put all that text into my Java files. Of course what I first thought of is reading from a ...

7. Problem in reading a file through getResourceAsStream    java-forums.org

public class start { private static final String absName = "/test/src/1.txt"; public static void main(String[] args) { // TODO Auto-generated method stub InputStream s = start.class.getResourceAsStream(absName); System.out.println(s.toString()); } } I have a text file "1.txt" and I have put that text file in the folder /test/src/ and want to read it by using the InputStream class, but I am unable to ...

8. Reading .bin files    java-forums.org

9. file reading    java-forums.org





10. Reading a file    java-forums.org

11. To read tags from file    java-forums.org

From file read the data : e Output: ERROR: Mismatching tags on line 1: and ! Code is: import java.io.BufferedReader; import java.io.FileReader; import java.util.*; class Test6{ public static void main(String[] args)throws Exception{ Stack stack = new Stack(); BufferedReader br = new BufferedReader(new FileReader("c://test//assignment//input7.txt")); String s; int counter=0; while((s=br.readLine())!=null){ char temp[] = s.toCharArray(); for(int i=0;i

12. Reading a file from the internet?    java-forums.org

Hi everyone, I am currently writing a programme, and I came across an issue. The only solution I saw was to host the required files on my site and have the programme read them from there. The only problem was that I have no idea how to do such a thing. I googled it and I read URL (Java 2 Platform ...

13. Problem reading from a file    java-forums.org

Hi, The program should read commands from a text file. Example: save name Sara Smith; phone 0344444; address unit23 pt street then save it in an object person so I can have name=Sara Smith phone= 0344444 address= unit23 pt street the problem is I can see that it is splitted to 3 parts after using the Delimiter, when I scan the ...

14. Files, cannot read!    java-forums.org

15. Read BMP File...    java-forums.org

Hi all...I am a student and have to do a work in Java, and i'm kind off stuck :confused: Hi need to read a binary file (in this case a BMP file) and later tell some things about the file and let the user flip and re-size the image! But first I need help to read the file :S I now ...

16. problem reading file    java-forums.org

Below is part of my code: Java Code: import java.util.ArrayList; import java.io.IOException; import java.io.*; public class ReferenceManager { private ArrayList allProject; public ReferenceManager() { allProject = new ArrayList(); } public void addProject(Project theProject) { allProject.add(theProject); } public void ListProject() { System.out.println("List of all Projects\n"); for(Project project : allProject) { project.printProjectDetails(); } } public void saveAllProject() throws IOException { try { PrintWriter ...





17. Trouble with Try Catch blocks and file reading.    java-forums.org

Hello there, I had to improve this code in order for it to compile correctly and run in a fault tolerant way. I need my code to ask the user to enter a file to read from. If the file they enter isn't found, I need to repeatedly ask the user to re-enter a file name. Once a file is found, ...

18. How to read filename inside .gz file?    java-forums.org

gzip is usually a compression file contents. that is, a gzip on its own does not have any additional headers, so there is no storage of the file name in a plain gzip. we could figure out what the file name was before gzipping it. For example, if the file was called "myfile.sql.gz", we could probably guess the file name by ...

19. Reading from file?    java-forums.org

public void searchBrand() { Scanner readStreamBrand = null; String readBrand = null; String storeBrand = null; try { readStreamBrand = new Scanner(new FileInputStream("mods.txt")); System.out.print("Enter the manufacturer: "); brandName = keyboard.nextLine(); while (readStreamBrand.hasNextLine()) { readBrand = readStreamBrand.nextLine(); storeBrand = readBrand.substring(0, readBrand.indexOf(",")); if (storeBrand.equalsIgnoreCase(brandName)) { break; } else { storeBrand = null; } } if (storeBrand == null) //brand name could not be ...

20. read the file header    java-forums.org

21. reading from a file    java-forums.org

import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Split { public static void main(String args[]) { File file = new File("test.txt"); try { FileReader fr = new FileReader(file); BufferedReader reader = new BufferedReader(fr); String read = ""; while ((read = reader.readLine()) != null) { String[] tokens = read.split(","); for (int i = 0; i < tokens.length; i++) { System.out.println("Array ...

22. File Read Problem    java-forums.org

File Read Problem Ok here's my problem, I am trying to make a login screen for class. The assignment was that the login screen was supposed to be able to read and write information to a series of log files so that upon re-launch the program would have all the prior usernames read in so that you wouldn't have ...

23. Read from two files    java-forums.org

24. Reading extra /n on file.    java-forums.org

Im reading a .txt file with this function: public void leerArchivo() throws IOException { File input = new File("Estadisticas.txt"); FileReader in = new FileReader(input); int c; String st=new String(); while((c=in.read())!=(-1)) { contL++; st=new String(); while((char)c!='\n') { st=st+(char)c; // conversion de datos c=in.read(); } System.out.println(st); } System.out.println("FILE END"); in.close(); } example of the text file: 1 2 3 4 5 6 7 ...

25. How to read SGML files using Java    java-forums.org

Hi.. I'm doing my project on Text Categorization.I've got a text categorisation test collection called Reuters-21578 for my Information Retrieval project. It is distributed in 22 files. Each of the first 21 files (reut2-000.sgm through reut2-020.sgm) contains 1000 documents, while the last (reut2-021.sgm) contains 578 documents. The files are in SGML format. Each of the 22 files begins with a document ...

26. Reading from a file.    java-forums.org

27. Reading from file problem    java-forums.org

public class ReadIt { public static void main(String[] args) throws IOException { // Going to calculate how long it will take me to earn the lazy's their gold myIntro.PrintIntro(); File inFile = new File ("totalHours.txt"); if(inFile.exists()) [highlight]System.out.println("It exists");[/highlight] Scanner meh = new Scanner(inFile); String line; while(meh.hasNext()) { //********the next line of code does not process from text file***** line = input.nextLine(); ...

28. Starting to read a file from row N ?    java-forums.org

29. Reading files JAVA    java-forums.org

How do I make it so that it doesn't do anything for the first line? This is what i got so far: while(trace != null) { String[]a = trace.split(","); name[i] = (a[0]).trim(); normalhoursworked[i] = Double.parseDouble((a[1]).trim()); overtimehoursworked[i] = Double.parseDouble((a[2]).trim()); bonusPaid[i] = Double.parseDouble((a[3]).trim()); System.out.println(normalhoursworked[i]+" "+ overtimehoursworked[i] +" "+bonusPaid[i]+" "+name); i++; trace = buffer.readLine(); }

30. Reading a File and Ignoring White Space    java-forums.org

How can I read a text file and ignore whitespace? I'm using a delimiter to parse commas in the file. When the file content has no spaces, the code runs, but when I put spaces between the words in the file, a NoSuchElement exception is thrown. For example, here is a line: Jones,Jack,3.5,AppliedMath This line is read just fine. But if ...

31. File Reading..Help Needed    java-forums.org

Hi All, I just now started learning about File Operation(Reading, Writing) in java. And I have a requirement. I have to read a text file which is about 1 or 1.5 mb in size. I am not sure about which class to use to read the files. Could anyone help me in learning basic file operations by providing some links where ...

32. Reading data from file    java-forums.org

I am familiar with being able to read in data from a file and print it on the console or to a new file. However, what I don't understand is how to navigate the file structure. An example being that I don't want the data stored on the first line and I need to make regular backtracks to the second line ...

33. Help with File reading    java-forums.org

34. Help reading large files    java-forums.org

Hello, I hope you can help me puzzle this newbie conundrum out ! My eventual goal is to create an RSAPSS digital signature of a file. This question specifically relates to the update method prior to calling the sign method. As you probably know, update() accepts input of ByteBuffer, byte and byte[]. I know for a fact that many files I ...

35. Reading Multiple Files.    java-forums.org

Hi, I am new in Java, I have 10 files (say a1.txt, a2.txt, a3.txt,..,a10.txt) each with 5,000 data (single column). Now I can write a program to read a single file and display using JTable. But, I can not find a way to write a program that can read all the files, and display them (in different columns). Could someone give ...

36. Can't read from my file    java-forums.org

I can't figure why my program isn't reading input from a text file. I'm using the file name as the String parameter for the constructor, but keep getting the exception file is not found even though they are in the same folder. Classy.txt is listed right below Tinker.java in the same file. What's the problem? Java Code: import java.io.BufferedReader; import java.io.File; ...

37. reading a file problem    java-forums.org

public String [] loadFile (String fileName){ int i = 0; int j = 0; try{ FileInputStream fstream = new FileInputStream(fileName); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); while (br.readLine() != null) { i++; } in.close(); }catch (Exception e){//Catch exception if any System.err.println("Error: " + e.getMessage()); } String sentences[] = new String [i]; try{ FileInputStream fstream = new ...

38. Reading files    java-forums.org

try{ // Open the file that is the first // command line parameter FileInputStream fstream = new FileInputStream("testing.txt"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; //Read File Line By Line while ((strLine = br.readLine()) != null) { System.out.println(strLine); } //Close the input stream in.close(); }catch (Exception e){//Catch exception if ...

39. Reading nextInt() then nextLine() form a file.    java-forums.org

I'm making a database to hold all information about item/spells/races/npcs/etc. I am able to have it read the file, but In order to keep it organized in the file itself for easy editing/searching in the txt file I need to add letters and numbers to the file. Atm i'm trying to organize my "race" page 1: Human 2: Mutant 3: Phill ...

40. reading from onenote file with java    java-forums.org

41. Using the Java.io to read an object from the command line    java-forums.org

Hey guys. In order to practice Java programming (I've just recently started), I created a "Matrix" class. For those who do not know, a matrix is at its basic just a double array. My problem is in trying to get my main method to read a double array from the command line. For instance, I want the user to write "{{1,2},{1,4}}", ...

43. Need a solution to read and store data from a file    java-forums.org

Hii everyone...I want to know how to store the input values which are read from a file. The input values are all double values in a line separated by spaces. I want to read these values one after the other and store in a double typed variable. I actually wrote, FileReader fr=new FileReader(filename); BufferedReader in=new BufferedReader(fr); while(true) { String line=in.readLine();//here i ...

44. Read a file automatically    java-forums.org

Hi, I have a program where I need to open and read an excel file. I have finished developing this application but has a problem. I need to open and read an xls file in this program. The same xls has to be read all the time when I run the application. but I have to distribute this application to many ...

45. Reading In File Names    java-forums.org

I was wondering if I would be able to read in the name of files and add them to an array. So if I had 5 files in a folder called "File1.m4a", "File2.m4a", "File3.m4a", "File4.m4a", "File5.m4a", the program would set array "fileNames" as fileNames[0] = "File1", fileNames[1] = "File2" etc. (It would be fine if it read them in as "File1.m4a", ...

46. Reading from file    java-forums.org

Hi, I am new to java and wish to implement a program, that will read numbers from a text file, put them into an array so that I can then perform an Insertion sort on them. I have managed to get an insertion sort working so far, with a fixed array, but can not do it reading an array from file, ...

47. Reading file    java-forums.org

48. Read from file    java-forums.org

hi, am trying to create a login method, where details are saved in text files 2 different(login details, contact details) I managed to read from the file and display it in objects like text fields, but cannot synchronise the details. I want the person who is logged in contact details displayed, but at the moment I can only make it work ...

49. Read from file    forums.oracle.com

50. Command line file read    forums.oracle.com

51. file closing after read    forums.oracle.com

52. Reading files FASTLY    forums.oracle.com

53. Reading Files    forums.oracle.com

When using FileReader, do the text files you want to read have to be placed in a certain place? Because I've been trying to pass a file as a parameter, but it's been throwing the FileNotFoundException, even though the file definitely exists. Here's a clipping of the code if it helps. I'm using Eclipse. public void readDictionary() throws IOException { //Sets ...

54. java read .plist files    forums.oracle.com

55. about " # " and reading from file.    forums.oracle.com

So, this should be a simple question, what's the usage of symbol # ? or is there any? I tried searching everywhere (afaik) but no luck. Why I'm asking this, is that I have an ongoing small project that I'm trying to do. It's a election vote counter or similiar. I'm reading the names and numbers of people to be voted ...

56. Reading from a File.    forums.oracle.com

57. reading in an html file    forums.oracle.com

Hi, I would like to know how to be able to read in an html file using java. right now, I am trying bufferedreader and filereader in java.io library. However, it seems like it will be hard to edit the text once the file is read. So, is there a more convenient way to read in an html file so that ...

58. Reading in an html file    forums.oracle.com

Depends on what kind of editing you want to support. The simplest thing to do is to use a plain old JTextArea. That would allow your users to edit the HTML text, but it would be totally not HTML-aware. It wouldn't check HTML syntax, it wouldn't allow them to preview the HTML, it wouldn't have any easy way to insert new ...

59. Reading in filename as String    forums.oracle.com

61. File reading and enforced use of try-catch blocks    forums.oracle.com

Thank you to both. Yes, that works. So, do I understand that the try block acts like a method to the extent that any variables defined within the block can only be used within the block? So if I have more statements to do with reading from the file, I need to continue entering those statements within the try block? Does ...

62. How to read multiple dat files.    forums.oracle.com

Hello Everyone! I am working on a project that requires one file that creates a JFrame with a current file title, JTextFields that accesses two .dat files and a JButton. The user clicks a JButton to cycle through the first sequential .dat file. When the end of the first file is reached the file is closed, the JFrame title is changed ...

64. File Reading    forums.oracle.com

Copy.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package file; /** * * @author FORNX */ import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.StringTokenizer; public class Copy { public static void main(String[] args) throws IOException { File inputFile = new File("D:/vsp1/farrago.txt"); DataInputStream dis = null; ...

65. File Reading    forums.oracle.com

Hi All... is there a way to read only a specific part of a file in java? can I use the FileReader to do this..? What i want is to read a given range of lines in a JSP file using Java..may b the statements within a etc... can anyone suggest me a way to do this??? thanks for any ...

66. Trouble With Reading a File In    forums.oracle.com

Here are the errors I'm getting: heather-millers-macbook-pro:~ heathermiller$ javac ReadStudentData.java ReadStudentData.java:22: cannot find symbol symbol : class Student location: class Homework5.ReadStudentData public Student[] arrayStudent() ^ ReadStudentData.java:31: cannot find symbol symbol : class Student location: class Homework5.ReadStudentData Student stud[] = new Student[10]; ^ ReadStudentData.java:31: cannot find symbol symbol : class Student location: class Homework5.ReadStudentData Student stud[] = new Student[10]; ^ ReadStudentData.java:54: cannot ...

67. file read problems    forums.oracle.com

while(handle.read()!= -1) { System.out.print((char)handle.read()); } where handle is an object of FileInputStream class. What it does is print the alternate charcters in the file starting from the second character. Why is it behaving in such a manner? Please throw some light. Alternatively, i used a code snippet from java 2 complete reference which is working just fine. What i want to ...

68. reading from a file    forums.oracle.com

Hi, I am fairly new to java and I am having a difficult time with the manipulating data from a file. At the same time I am not have a problem printing or reading from the file. All I am really looking for is the operator statements necessary to carry out specific tasks. The file given has the following format of: ...

69. READING ONE STRING IN A FILE    forums.oracle.com

So I'm making a program such that if a user type A, it will return 1, 2, and 3 seperately. Similarly, if user type C, it will return 7, 8, 9 seperately. Forget the (System.in), as I know what to do with that. What I'm confused is the file processing. Any idea what must be done?

71. Reading char from file    forums.oracle.com

Another thing, for each line you are calling the Occurence method (should be lowercase) twice. That will certainly cause your program to be slow. That method returns an int value, why not store it in a variable that you can use instead of calling the method everytime. Mind you as per my previous reply I wouldn't do it this way.

72. Trouble reading in a file    forums.oracle.com

One thing to suggest is not to use the (I think it's called) back-slash character "\". Because this character is used as the escape character, if you use this in a Java String you have to place two backslashes in a row in order to get one in the actual String. To simplify, use a forward-slash instead, "/".

73. How do i read from file...    forums.oracle.com

init: deps-jar: Created dir: E:\Java\Average\build\classes Compiling 1 source file to E:\Java\Average\build\classes E:\Java\Average\src\Average.java:12: cannot find symbol symbol : class File location: class Average File f = new File("I:/JAVA 2007 _ 2008/~ SY 2007 2008 ~/Student Lessons/Lesson A13 - Exceptions and File IO/Lab Assignment A13.2 - Data file/numbers.txt"); E:\Java\Average\src\Average.java:12: cannot find symbol symbol : class File location: class Average File f = new ...

74. How to read .dat files that are hidden?    forums.oracle.com

Is it possible to read .dat files that are set to hidden? 'cause what i did was i created a .dat file and set its attributes to hidden and my Read file code cannot read hidden files. here's my Read file code: Scanner read=new Scanner(FileReader("C:\password.dat")); and another thing, how do you Write a .dat file that is hidden too? 'cause my ...

75. Reading the method names(setters) from the file .. Is this possible?    forums.oracle.com

Hi all, I have a class which has about 40 attributes. To simplify, i will just mention a couple of them. class Address { private String firstName; private String lastName; private String city; /// and their corresponding setters and getters } Now i want to create an object of class Address and populate the data from a text file. data.txt firstName:Eli ...

76. Reading integers from file problem...    forums.oracle.com

77. Reading blank space from a file    forums.oracle.com

Ha. Ha . Ha.... Okay. Thanks for your help. I'm supposed to reference the string object. Not the file. My stupidity blinded me. Not to be rude or anything, and I know that everyone on here, especially people who know that others are doing assignments, want to make people work and not just give them answers, but if you would have ...

78. File Reading containg time Message hexcode    forums.oracle.com

79. Reading integers from a file, ignoring everything else    forums.oracle.com

I'm trying to get my program to read integers from a file and ignore everything else. I thought that nextInt() was the answer, but when I tried it, it gave me an "Input Mismatch" exception when it came to a letter. So is there some other way to use Scanner to get the integers from a text file when there are ...

80. Reading from files is very slow    forums.oracle.com

I would think that the source of your problem is your use of strings: String sPs2=""; String sPs2Data=""; try { bPs2 = new BufferedReader(new FileReader(destinationMAP1)); while((sPs2 = bPs2.readLine()) != null) { sPs2Data+=sPs2; } sPs2Data=sPs2Data; } The main problem being: sPs2Data+=sPs2; Strings are immutable. So with each "sPs2Data+=sPs2;" you are creating a completely new String in memory, copying the contents from the ...

81. I need to read a file    forums.oracle.com

Try this... String path = "path to your file"; try { BufferedReader reader = new BufferedReader ( new FileReader ( new File(path))); string line = reader.readLine(); //if the words are seperated with the same //number of '_' characters, then you may use //string tokenizer StringTokenizer st = new StringTokenizer(line, "________"); while (st.hasMoreTokens()) { string word = st.nextToken(); //you can now insert ...

82. Is it possible to read from other files and get statistics with Java?    forums.oracle.com

I was wondering if it is possible through java to read an external file and get statistics from it, such as how many words in it have 2 characters, and how many sentences there are in it. I tried googling to find out if it was possible, but I didn't know what kind of terminology would be associated with such a ...

83. Reading a file and then encrypt it    forums.oracle.com

85. Read from file and assign integers with values    forums.oracle.com

How can I get a number from a text file and then assign it to an integer in my program? For example if I got a number like this: 0-13-089-4966 how can I assign the first number to an integer and the second number into another integer and so on until I got all the integers filled with values. The program ...

86. Reading non-standard variable types from file    forums.oracle.com

Hi, I'm currently on a programming course, and I need some help with an excercise. The excercise is about adding save, load and undo features to an Infocom style text adventure. The save file must contain three variables: The location of the player (Area), the items the player had (ArrayList) and the number of passed turns (int.) Is it possible to ...

87. Reading Data From A file    forums.oracle.com

88. Read xsd file    forums.oracle.com

89. How to read contents of more than 2 files.    forums.oracle.com

hi all help me. How to read contents of more than 2 files. For reading a file contents we uses normally FileInputStream For reading two file contents we uses normally SequenceInputStream But which class we have to use for reading contents of more than 2 files at a time thanks in advance.

90. Reading from a file    forums.oracle.com

Hi Friends, I m new to java In my java code i ll write a program for creating a virtual server. My java code ll also have "write to file method" where i ll write the outputs to the mentioned filename with proper path. But now i am in need of using a "reading from a file" for the output file ...

91. inserting a file to read from command line    forums.oracle.com

I am having trouble finding how i can insert a file address into the command prompt so my code will then use this to read items from the file. This is what i have for reading the file: System.out.print("Please enter file name: "); String aFile = ""; aFile = console.nextLine(); Scanner inFile = new Scanner(new FileReader(aFile)); As this is the last ...

92. How to Read XL file    forums.oracle.com

Hi Can any body tell me how to read XL file using java. I am using POI jar. Basically the following program display only the top most left column. This is the sample XL file i have. I need to display dynamically all the values according to the column name lilke EmployeeName etc.. Employee Name Specialization Designation Anbu Programming Senior Programmer ...

93. Reading an int from a particular location in a file    forums.oracle.com

Hi, I've seen other topics about reading ints from files/strings etc, but I don't think I've found one the same as this. I have an input file "maxSolution.sol" that contains an int that I need to use in my program c Parsing PB file... c Converting 0 PB-constraints to clauses... c -- Unit propagations: (none) c -- Detecting intervals from adjacent ...

94. Reading Fixed Length Files    forums.oracle.com

I can read the file with no problem and i can read the properties file with no problem. Now i need to parse the line from the file with the information i got from the properties. Someone suggested substring would be the way to do this... i can try this, it looks like it wants the starting and ending index.. I'm ...

95. Reading from file    forums.oracle.com

96. help with reading from a file    forums.oracle.com

I haven't looked closely at your code but I have a few tips. Do you really want it to print out the average everytime around the loop or just once after all the values have been read in? Why not use nextLine instead. You can then split the line and add the second value to male or female token based on ...

97. Need help with reading files    forums.oracle.com

methinks you have an error in your programming, not in java's implementation of Scanner.nextLine! You are calling nextLine 3 times in your while loop, but only check for the presense of the line once at the top of the loop. This code is then eventually doomed to fail. Well, actually it has a one in three chance of not failing. It ...

98. not reading in IO    forums.oracle.com

init: deps-jar: compile: run: Menu.selectLargeCoffee: Selecting Large Coffee Menu.selectSugar: Selecting Sugar Menu.selectextraSugar: Selecting Extra Sugar Menu.selectCreamer: Selecting Creamer Menu.selectCreamer: Selecting Creamer Calling computePayment Calling displayMsg Large coffee selected* Returned to computePayment Now calling set Paid In full Done making selections. Compute Payment and Change Calling computePayment Calling displayMsg Large coffee selected* Returned to computePayment Now entering saveAllOrders() Now entering readOrders() Error ...

99. Reading a character from a file    forums.oracle.com

100. Charts and Reading Files    forums.oracle.com

Next of all, are you supposed to be mixing awt and swing components. I'm no GUI expert, but what I've learned from the forums is that most suggest that you shouldn't mix the two, and in fact most stick with just swing components. It almost looks to me like part of your program was created by one person (your instructor?) and ...