Textfield

description
description for singleline textfield. create a texfield with

controlP5.addTextfield(theName,theX,theY,theWidth,theHeight);
+Example
import controlP5.*;

ControlP5 controlP5;

int myColorBackground = color(0,0,0);

String textValue = "";

Textfield myTextfield;

void setup() {
  size(400,400);
  frameRate(25);
  controlP5 = new ControlP5(this);
  myTextfield = controlP5.addTextfield("texts",100,160,200,20);
  myTextfield.setFocus(true);
  controlP5.addTextfield("textValue",100,200,200,20);
}

void draw() {
  background(myColorBackground);
}


void controlEvent(ControlEvent theEvent) {
  println("abc");
}

void mousePressed() {
  println(myTextfield.getText());
}


public void texts(String theText) {
  println("a textfield event. "+theText);
  println("textValue : "+textValue);
}
constructors
Methods
getText ( )
get the current text of the textfield.
isFocus ( )
check if the textfield is active and in focus.
setFocus ( )
set the textfield's focus to true or false.
setPasswordMode ( )
set the mode of the textfield to password mode, each character is shown as a "*" like e.g. in online password forms.
setValue ( )
set the value of the textfield.
usage
Web & Application
related