processing id create

Solutions on MaxInterview for processing id create by the best coders in the world

showing results for - "processing id create"
Malachi
20 Jun 2020
1/** 
2 * No Repeat ID Input (v1.10)
3 * by GoToLoop (2013/Nov)
4 * 
5 * forum.processing.org/two/discussion/869
6 * /check-array-contents-with-arraylist
7 */
8 
9import static javax.swing.JOptionPane.*;
10 
11final StringList ids = new StringList( new String[] {
12  "Eric", "Beth", "Katniss"
13} 
14);
15 
16void draw() {
17  println(ids);
18 
19  final String id = showInputDialog("Please enter new ID");
20 
21  if (id == null)   exit();
22 
23  else if ("".equals(id))
24    showMessageDialog(null, "Empty ID Input!!!", 
25    "Alert", ERROR_MESSAGE);
26 
27  else if (ids.hasValue(id))
28    showMessageDialog(null, "ID \"" + id + "\" exists already!!!", 
29    "Alert", ERROR_MESSAGE);
30 
31  else {
32    showMessageDialog(null, "ID \"" + id + "\" successfully added!!!", 
33    "Info", INFORMATION_MESSAGE);
34    ids.append(id);
35  }
36}
queries leading to this page
processing id createprocessing id create