title: How to show dataframe table from Flask in JScrollPane
body: <p>Firstly, I use python Flask to return a dataframe:</p>
  <pre><code>@app.route('/')
  def predict():
      # this part will be replaced by the prediction result of a model, e.g. SVC
      test_file = &quot;../Data/test.csv&quot;
      df = pd.read_csv(test_file).iloc[:, 2:9]
      return df.to_html(classes=&quot;table table-striped&quot;,index=False)
  return df.to_html(classes=&quot;table table-striped&quot;,index=False)
  </code></pre>
  <p>Then, I want to show the table in JScrollPane in my Java program:</p>
  <pre><code>if(ae.getSource() == predictButton)
  {
              try {
              URL url = new URL(&quot;http://127.0.0.1:5000/&quot;);
              HttpURLConnection conn = (HttpURLConnection) url.openConnection();
              conn.setRequestMethod(&quot;GET&quot;);
              conn.setRequestProperty(&quot;Accept&quot;, &quot;application/json&quot;);
              
              if (conn.getResponseCode() != 200) {
                  throw new RuntimeException(&quot;Failed : HTTP error code : &quot;
                          + conn.getResponseCode());
              }
              BufferedReader br = new BufferedReader(new InputStreamReader(
                       (conn.getInputStream())));
              //tableScrollPane.setViewportView(br);???? it does not work
              conn.disconnect();
              } catch (MalformedURLException e) {
                  e.printStackTrace();
              }catch (IOException e){
                  e.printStackTrace();
              }
  }
  
  </code></pre>
  <p>After pressing the &quot;predictButton&quot;, JscrollPane should show the table from Flask. Any help would be appreciated!</p>