Hello, I am new to this site. I have posted a few times in devshed, I have also asked a similar question as I am now. Thanks to several over at devshed I have got a calculator program working and added a few things to it. My question is that, I added a textarea, and I want to be able to open simple text files, and save to a text file. I have done some googling and looked around at java.sun, but im still not sure which methods/classes I need to accomplish this. I have already coded the menus for save/open, but I dont know how to actually search for and OPEN a text or SAVE AS a text. If anyone can point me in the right direction it would be greatly appreciated. BTW, MyDevShedPost this is the post at devshed, complete with the code for my calculator. Thanks in advance.
Forgetting about your Swing interface for a minute, do you know how to write a program with a main method to read a file and output to the result to standard out? If so, you are most of the way there.
No, not at all. Although I have been playing around with it and got it to open a text file, BUT it only displayed the first line, AND you had to type in the filename. BUT this is far from what I want to do, as I couldnt navigate through the file system and it only opened 1 line. I have since found that I need to be looking at FileReader and FileWriter. Basically what I need to do is understand what it actually does to save and open a file. What I mean does it just copy it straight in? Or does it have to convert it? Any information will help. As I find the java.sun is informative, but not user friendly. Its still somewhat Greek to me. Thanks.