1.
Read all Texte in TextBox
import [Link].*;
class Test1 {
public static void main (String [] arg){
JTextBox botext = new JTextBox() ;
File f = new File("[Link]");
try {
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String c ;
while((c =[Link]())!=null){
[Link] (c);
}
[Link]();
}
catch(IOException i){
[Link]("Error");
}
}
}
2. 2
eme
Methode
import [Link].*;
class FileRead
{
public static void main(String args[])
{
try{
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream("[Link]");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
//Read File Line By Line
while ((strLine = [Link]()) != null) {
// Print the content on the console
[Link] (strLine);
}
//Close the input stream
[Link]();
}catch (Exception e){//Catch exception if any
[Link]("Error: " + [Link]());
}
}
}
Mohlaid0892@[Link]