Code example for JSONObject: Parsing JSON documents

Methods: getIntgetJSONObject

0
    this.width = width;
 
  } 
 
  public UIARect(JSONObject o) throws JSONException {
    JSONObject origin = o.getJSONObject("origin");
    x = origin.getInt("x");
    y = origin.getInt("y");
 
    JSONObject size = o.getJSONObject("size");
    height = size.getInt("height");
    width = size.getInt("width");
  } 
 
  public String toString() {
    return "origin(x=" + x + ",y=" + y + "),size(height=" + height + ",width=" + width + ")";
  } 
 
  public int getX() { 
    return x;
Experience pair programming with AI  Get Codota for Java