The Artima Developer Community
Sponsored Link •

Design Forum
File Writing& Reading

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
DAYO

Posts: 22
Nickname: done
Registered: Jun, 2002

File Writing& Reading Posted: Jun 28, 2002 5:28 AM
Reply to this message Reply
Advertisement
I am trying to write the content of the textfields
to a file on my computer.
i want to write the content of the textfield to a text file.
When it has been written the content should look like
this:
content of Textfield1 followed by new line x'ter
content of Textfield2 followed by new line x'ter
content of Textfield3 followed by new line x'ter
content of Textfield4 followed by new line x'ter
end of file x'ter.
Also, i want to be able to write content of a Textfile
to the Textfield.Like this:
Textfield1=line1
Textfield2=line2
Textfield3=line3
Textfield3=line4
How can i achieve this?
Here is a section of a program i have written
package DAYOSPACKAGE.test1;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
//package DAYOSPACKAGE.test1;
public class testing2 extends JFrame
{ private JTextField T1[];
private JButton B1,B2;
private JLabel L1[];
private JPanel P1,P2,P3;
private ObjectOutputStream output;
public testing2()
{ T1=new JTextField[4];
for(int i=0;i<T1.length;i++)
{ T1=new JTextField();
}

L1=new JLabel[4];
for(int i=0;i<L1.length;i++)
{ L1=new JLabel(" "+i);
}
....etc

Topic: simultaneous access to a web application Previous Topic   Next Topic Topic: seting the text in JFrame's center(JTextpane)drawing lines and fonts

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use