I'm developing a desktop application in Netbeans using Java Swing. I'm using a weather condition API to show weekly results. After parsing json file, the key "icon" is not displaying as an image in the text pane. Can someone explain me that how can I make that icons visible? Here is my sample code after requesting. (Can't show the connection code because of API KEY) I'm parsing the data :
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
JsonParser jp = new JsonParser();
JsonElement root = null;
root = jp.parse(response.body());
JsonObject jsonobj = root.getAsJsonObject();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String req_result = gson.toJson(jsonobj.get("result"));
havayı_listele.setText(req_result.replaceAll("\\{", "").replaceAll("\\},", "").replaceAll("\"", "").replaceAll("\\}", "").replaceAll("\\[", "").replaceAll("\\]", ""));
//JSON FILE LOOKS LIKE THIS
{
"result": [
{
"date": "24.09.2018",
"day": "Pazartesi",
"icon": "https://image.flaticon.com/icons/svg/143/143769.svg",
"description": "açık",
"status": "Clear",
"degree": "31",
"min": "11.6",
"max": "31",
"night": "11.6",
"humidity": "17"
},
{
"date": "25.09.2018",
"day": "Salı",
"icon": "https://image.flaticon.com/icons/svg/143/143769.svg",
"description": "yağmurlu",
"status": "Rainy",
"degree": "24.14",
"min": "7.63",
"max": "25.82",
"night": "9.09",
"humidity": "35"
},
"..."
]
}
My textPane is look like this after some arrangements : https://i.stack.imgur.com/SAmPC.png
I wanna display the icon links as images.