import java.io.*;
import java.util.*;
import javax.swing.*;
import java.util.StringTokenizer;
public class Sample {
public static int count = 0;
public static String s[]=new String[2];
public static String s2;
public static String s3;
public static void main (String args[]) throws IOException{
isRead();
}
public static void isRead()throws IOException{
int count2 = 0;
BufferedReader lnr = new BufferedReader (new FileReader("subjects.txt"));
String line;
String ask;
while ((line = lnr.readLine())!=null){
StringTokenizer st = new StringTokenizer(line);
s[count2] = st.nextToken();
count2++;
}
isInput();
}
public static void isInput() throws IOException{
FileWriter writer = new FileWriter("output.txt");
int i;
String ask = JOptionPane.showInputDialog("Enter.");
if(ask.equals(s[0])){
StringTokenizer st = new StringTokenizer(ask,s[0],true);
Please help me on how to fix this. It only writes the last one, which is IT110, and no Math17 appears. Was the first one that i write was saved? Or everytime i write a new one, the old one will be deleted..I hope you can help me. Thank you.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.