import org.json.*; // download json library and install in processing // details here: https://github.com/agoransson/JSON-processing void setup() { JSONObject obj = new JSONObject(); try { obj.put("myint", 5); obj.put("myfloat", 5.5); } catch(JSONException e) { e.printStackTrace(); } println( obj ); int val=-1; try { val=obj.getInt("myint"); print(val); } catch(JSONException e) { e.printStackTrace(); } // double fval=obj.getDouble("myfloat"); // print(fval); }