Hi all,
Using Vaadin 7.1.3, i do not know how to display some text in several lines inside a TextField.
I tried to add “\r\n” or “/r/n” at the end of each line, but the text is still displayed in one single line.
BufferedReader br = null;
try {
String sCurrentLine;
br = new BufferedReader(new FileReader(file));
while ((sCurrentLine = br.readLine()) != null) {
contentOfFile = contentOfFile + "\r\n" + sCurrentLine;
}
System.out.println(contentOfFile);
}
catch (IOException e) {...}
finally {
try {if (br != null)br.close();}
catch (IOException ex) {...}
}
TextField txtOutputContentOfFile = new TextField();
txtOutputContentOfFile.setWidth("95%");//ie6
txtOutputContentOfFile.setHeight("300px");
txtOutputContentOfFile.setValue(contentOfFile);
=> Inside the textfield, the text appears in one line instead of 50 lines
Any idea ?
Eric