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

saveString with button

$
0
0

Hello everyone, I want to save the text written in textArea,

import processing.video.*;
import g4p_controls.*;

import java.awt.Font;
GTextArea textArea;
String txtMain ="";






Capture cam;
GButton btnSave;

int n = 1;

void setup() {
  size(1024,768);


  textArea = new GTextArea(this, 110, 670, 200, 100, G4P.SCROLLBARS_BOTH | G4P.SCROLLBARS_AUTOHIDE);
  textArea.setFont(new Font("", Font.PLAIN, 20));

    cam = new Capture(this,640,480);
    cam.start();
  }
}

void draw() {
  if (cam.available() == true) {
    cam.read();
  }
  image(cam,0,0,width,height);
}


public void handleButtonEvents(GButton button, GEvent event) {
  if (button == btnSave) {


}

in reference there is the procedure:

String words = "apple bear cat dog"; String[] list = split(words, ' ');

saveStrings("nouns.txt", list);

I have difficulty understanding how to add in my code, can you help me by explaining?

Thank you!


Viewing all articles
Browse latest Browse all 2896

Trending Articles