How to input text without a popup

edited September 2015 in How To...

I am developing a little app right now using processing that lets the user enter sentences ( I use JOptionPane class to bring a popup so the user can type in a sentence). That sentence is then converted to text blocks. I would like the user to be able to modify the text inside a block by double-clicking on it. I would prefer it to be editable directly in the text block and not in a popup. A popup is great for the first sentence input but not really for modifying a small text block. Do you know how I could do this ?

Example: The user enters this sentence: Tomorrow, the cat will ride a mountain bike in the forest. Then slices the sentence just after Tomorrow, creating a text block containing the single word Tomorrow,. Then the users wants to edit Tomorrow, block and make it tomorrow. Is there any way this could be done without popup ?

Thank you very much

Answers

  • Answer ✓

    Don't you want to use Processing GUI libraries, instead of Java? G4P or ControlP5 they provide text fields that you can use. Alternatively, you can implement your own control.

  • edited September 2015

    Thank you very much for your answer, I am new to processing and I did not know about these. They seem very nice for java mode. I need a GUI librairie like those that would work in processingjs, any idea on this ? I just need the textfield option. I would prefer working with the same librairie in java mode and processingjs mode, but if that is impossible wich librairie would you recommend for processingjs ?

  • I didn't try it, but Guido should work for both modes.

  • I did not see any textfield feature into Guido but you still ansered my question. So I will create a new topic for processingjs. Thank you !

Sign In or Register to comment.