I can't control when the response in the textfield.

edited October 2017 in Library Questions

Hello everyone,

I have a little problem with my programme.

I would like to control if the text in the textfield is good or not but it doesn't work.

I can get the text in the textfield but when I want to check if it's good it doesn't work.

Some one has a solution for me please?

The code is here :

String Reponse = "oui";

import controlP5.*;

ControlP5 cp5;

void setup() {

  PFont font = createFont("arial",20);

  cp5 = new ControlP5(this);

     .getCaptionLabel().align(ControlP5.CENTER, ControlP5.CENTER)


void draw() {
  text("Ecrivez votre réponse ici",20,90);
  text(cp5.get(Textfield.class,"input").getText(), 360,130);
  if(cp5.get(Textfield.class,"input").getText() == Reponse){

public void clear() {

thank you


  • edit post, highlight code, press ctrl-o to format

    it doesn't work

    what do you expect, what happens instead?

  • Sorry i didn't know how to highlight the code thank you

    I would like to know if the text in the text filed is the same word that a preload text in the program (for example in my program i would like to know if in the text field the word is the same that the string reponse

  • edited October 2017

    Thank you very much it works.

    But I have another problem.

    As i want write in french in the textfield I need to use symbol like (ê or ë) but it's not possible, it write befor ¨ and e after.

    Someone have an idea?

    I use the library ControlP5

Sign In or Register to comment.