I'm taking on a new project and was hoping to get some help. I recently helped complete a Java application in which the user enters various inputs (of the type double or string)into text fields. The application then saves these inputs into a text document which is then used for a Fortran program. I now need to modify the application so that it reads the text file back into the application so that minor adjustments can be made without having to input all of the data again. Is this possible?

Thanks

Absolutely yes. Read the values from the file (depends on how the file is formatted, but you know that already) and put them into the text fields. After that it's exactly the same as the program you've already got - ie user changes the values in the text fields and you save the document.

Good to know it can be done! I know how to read the values from the file what methods would you suggest using to display those values back into the text fields? I that is where I am completely stumped.

Sorry that was grammatically incoherent-
Good to know it can be done! I know how to read the values from the file. What methods would you suggest using to display those values back into the text fields? That is where I am completely stumped.

Have you read the API doc for the text field classes? There are methods for setting the text that it displays. In Swing look at the super class for JTextField.
If you have the data in a String or convert it to String, then you can put that String into the text field.

Edited 6 Years Ago by NormR1: n/a

This question has already been answered. Start a new discussion instead.