We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
How would I get a typed input from user while processing is running?
Just like google's main pages type bar below image.
Thank you,
I've got 2 models:
Online: http://studio.processingtogether.com/sp/pad/export/ro.9Zo$UbIWYZEDR/latest And the 1 below:
/** * No Repeat ID Input (v1.10) * by GoToLoop (2013/Nov) * * forum.processing.org/two/discussion/869 * /check-array-contents-with-arraylist */ import static javax.swing.JOptionPane.*; final StringList ids = new StringList( new String[] { "Eric", "Beth", "Katniss" } ); void draw() { println(ids); final String id = showInputDialog("Please enter new ID"); if (id == null) exit(); else if ("".equals(id)) showMessageDialog(null, "Empty ID Input!!!", "Alert", ERROR_MESSAGE); else if (ids.hasValue(id)) showMessageDialog(null, "ID \"" + id + "\" exists already!!!", "Alert", ERROR_MESSAGE); else { showMessageDialog(null, "ID \"" + id + "\" successfully added!!!", "Info", INFORMATION_MESSAGE); ids.append(id); } }
Answers
I've got 2 models:
Online: http://studio.processingtogether.com/sp/pad/export/ro.9Zo$UbIWYZEDR/latest
And the 1 below: