Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

NullPointerException on GTextArea due to too many line feed

$
0
0

@quark I found another issue today. The following code runs fine:

// Need G4P library
import g4p_controls.*;

public void setup(){
  size(480, 320, JAVA2D);
  createGUI();

  myTextArea.setText("hello world");
}

public void draw(){
  background(230);
}

However, if I use too many \n to feed lines, it returns a NullPointerException. Example:

// Need G4P library
import g4p_controls.*;

public void setup(){
  size(480, 320, JAVA2D);
  createGUI();

  myTextArea.setText("\n\n\nhello world");
}

public void draw(){
  background(230);
}

Am I doing something wrong? Are there any workarounds? Thank you so much!


Viewing all articles
Browse latest Browse all 2896

Trending Articles