I get an IOException error when trying to compile this code:
public class TextEditor extends JDialog implements ActionListener {
public TextEditor (File fich,Frame owner) throws IOException{
super(owner,true);
fichier=fich;
String langage="//fortran_regex";
cree_ihm(langage);
};
public String config( String langage ) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader (langage));
String line = null;
StringBuilder stringBuilder = new StringBuilder();
String ls = System.getProperty("line.separator");
try {
while( ( line = reader.readLine() ) != null ) {
stringBuilder.append( line );
stringBuilder.append( ls );
}
return stringBuilder.toString();
} finally {
reader.close();
}
}
private void cree_ihm(String langage) throws IOException{
config(langage);
}
}
///////When calling main
import utils.TextEditor;
public class launch_editeur {
public static void main(String[] args) throws IOException{
TextEditor editeur=new TextEditor(null);
editeur.Affiche(true);
//editeur.setControlOn(false);
}
}
What is happening? Am I using it wrongly? I think it may have to do with the functions I called (or maybe with the classes? ) Thx