Tell me, please, how best to add data from JSON to ComboBox. The graphic part is made using Scene Builder, there is a class Controls, where all the id are registered. I give an example of a parser
public class Parser { private String filePath = "/Users/oleg/Documents/workspace/app/src/basebase.json"; public List<JSONObject> ParseJson() { List<JSONObject> resultList = new ArrayList<JSONObject>(); try { // read the json file FileReader reader = new FileReader(filePath); JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject) jsonParser.parse(reader); JSONObject first = (JSONObject) jsonObject.get("Sample"); resultList.add(first); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (ParseException ex) { ex.printStackTrace(); } catch (NullPointerException ex) { ex.printStackTrace(); } return resultList; I also demonstrate the structure of JSON
{ “Sample”: { “Text1”: 001, “Text2”: 002 }, “Sample2”: { “Text1”: 001, “Text2”: 002 } }