Reputation: 131
Maybe my title is not the best but here is what I really want.I have a file in which I have some lines.I have put each line in a JTextField
.
Here is an example. Let's say this is a line in a textfield
mary peterson teacher
Now what I want is to modify this line in the textfield and save it when I close the frame in the file like this
mary ruble teacher piano .
Can someone please give me an idea about how to do this?
Upvotes: 0
Views: 116
Reputation: 51565
Basically, you break the problem into smaller and smaller steps until you know how to code each step.
You first have to create a Java Swing GUI that contains a JTextField
and a JButton
that tells your Java code to bring up the next line of text.
Here's one way of breaking up the problem.
JTextField
JButton
left click, write line from JTextField
to output file, read next line from input file, display next line in the JTextField
.Upvotes: 2