src/com/company/Server/ReadWriteFiles.java
public ArrayList<String> spinnerOptions() {
        ArrayList<String> options = new ArrayList<>();

        try {
            JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));

            JSONArray listCounty = (JSONArray) obj.get("Counties");

            JSONObject county;

            for (int i = 0; i < listCounty.size(); i++) {
                county = (JSONObject) listCounty.get(i);

                options.add(county.get("name").toString());
            }

        } catch (IOException e) {
            e.printStackTrace();
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return options;
    }
/**
     * Method responsible for loading the spinner, from the JSON file with the name of the counties
     *
     * @return options list
     */
Method responsible for loading the spinner, from the JSON file with the name of the counties
@return options list
Method responsible for loading the spinner from the JSON file with the name of the counties @return options list
public ArrayList<String> spinnerOptions() {
        ArrayList<String> options = new ArrayList<>();
        try {
            JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));
            JSONArray listCounty = (JSONArray) obj.get("Counties");
            JSONObject county;
            for (int i = 0; i < listCounty.size(); i++) {
                county = (JSONObject) listCounty.get(i);
                options.add(county.get("name").toString());
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return options;
    }
public ArrayList < String > spinnerOptions ( ) { ArrayList < String > options = new ArrayList < > ( ) ; try { JSONObject obj = ( JSONObject ) jsonParser . parse ( new FileReader ( file . getPath ( ) ) ) ; JSONArray listCounty = ( JSONArray ) obj . get ( "Counties" ) ; JSONObject county ; for ( int i = 0 ; i < listCounty . size ( ) ; i ++ ) { county = ( JSONObject ) listCounty . get ( i ) ; options . add ( county . get ( "name" ) . toString ( ) ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } return options ; }
Method responsible for loading the spinner, from the JSON file with the name of the counties
 @return options list
Method responsible for loading the spinner from the JSON file with the name of the counties @return options list