Text Area component: how to perserve the format
If I input some text into a text Area, the format (new line for example) will disapear when those input is displayed in a static text component. how can I keep the format, at least for those new line.
HTML tags like
might help, but I can't ask every user to do that way.
Thank you very much!
[319 byte] By [
nxiangl] at [2007-11-26 7:59:21]

# 1
First, set the escape property of the static text to False. Then, in the visual designer, double click the button that submits the web page and use this sort of code for the action handler:
public String button1_action() {
String text = (String)textArea1.getText();
text = text.replaceAll("\\n", "
");
staticText1.setText(text);
return null;
}
mbohm at 2007-7-6 20:27:49 >
