Skip to content

Commit

Permalink
fixed send data to server task
Browse files Browse the repository at this point in the history
  • Loading branch information
ermismd committed Jul 19, 2023
1 parent 8fb4086 commit 976ea7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,17 @@ public void run(TaskMonitor taskMonitor) {

String jsonQuery = jsonObject.toJSONString();

String serverURL = "https://msysbio.gbiomed.kuleuven.be/complements/1281578/146891";
String serverURL = "https://msysbio.gbiomed.kuleuven.be/upload-abundance-table";

HttpPost httpPost = new HttpPost(serverURL);

// Set the JSON payload as a StringEntity
StringEntity entity = new StringEntity(jsonQuery);
httpPost.setEntity(entity);

// Set the server response as the status message
taskMonitor.setStatusMessage("Sent: " + jsonQuery);

// Set the request headers
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-type", "application/json");
Expand All @@ -124,8 +127,7 @@ public void run(TaskMonitor taskMonitor) {
JSONObject jsonResponse = (JSONObject) new JSONParser().parse(new InputStreamReader(responseEntity.getContent()));


// Set the server response as the status message
//taskMonitor.setStatusMessage("Server Response: " + responseString );


// Parse the response as a JSONObject and JSONArray
// JSONParser parser = new JSONParser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void actionPerformed(ActionEvent e) {
sendButton.setFont(sendButton.getFont().deriveFont(Font.BOLD, 14f)); // Set the font style and size of the button text
sendButton.setBackground(new Color(144, 238, 144)); // Set the background color of the button
sendButton.setFocusPainted(false); // Remove the focus border around the button
sendButton.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20)); // Add padding to the button
sendButton.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); // Add padding to the button

// Create a rounded border for the button
int borderRadius = 20;
Expand Down

0 comments on commit 976ea7c

Please sign in to comment.