I have a question about GTextArea.setText(). I wrote a function that loads some lines from a text file and then uses GTextArea.setText() to load the lines into a text area. It seemed to be skipping empty lines, and at first I thought it was the loadStrings() function that was skipping them. But it appears that GTextArea.setText() is skipping the blank lines. Is it supposed to do that?
Here’s my code:
public void loadHelp() {
File file = null;
int help = this.helpList.getSelectedIndex();
file = new File(dataPath(fileList[help]));
if (file.isFile()) {
String[] lines = loadStrings(file);
for (int i=0; i<lines.length; i++) {
println(i,lines[i]);
}
this.helpText.setText(lines);
this.message.setText("");
} else {
this.helpText.setText(descList);
this.message.setText("Help file not available.");
}
}
It displays the following messages in the console log:
0 Var Delay : variable length delay
1
2 CV 1 : delay amount in ms. (2 - 5000)
3
4 CV 2 : feedback amount (0 - 100%)
But as you can see in the screen print, the blank lines are missing.
Thanks again.