title: Button click makes gui freezes
body: <p>I want to call method from jButton. But when I hit the button, the GUI freezes. I've done so many research, and of course I know this kind of question has asked many times but I still can't find the solution. So I'm just gonna ask myself.</p>
  
  <p>here's my method:</p>
  
  <pre><code>     private void c2(){
      try{
          jTextArea1.setText("");
          int n = 0;
          float bnyAB,bnyA,bnyB=0;
          float supp,conf=0;
          for(int a=0;a&lt;dt.size();a++)
          {
             n++;
             for(int b=0+n;b&lt;dt.size();b++)
             {
                 bnyAB=sql2.c2(dt.get(a).getKode_barang(), dt.get(b).getKode_barang());
                 bnyA=dt.get(a).getNilai();
                 bnyB=dt.get(b).getNilai();
                 supp=bnyAB/Integer.parseInt(jTextField1.getText())*100;
                 if(supp&gt;=Float.parseFloat(jSpinner1.getValue().toString()))
                 {
                     conf=(bnyAB/bnyA)*100;
                     if(conf&gt;=Float.parseFloat(jSpinner2.getValue().toString()))
                         jTextArea1.setText(jTextArea1.getText()+" Jika membeli \" "+dt.get(a).getNama_barang()+" \" maka akan membeli \" "+dt.get(b).getNama_barang()+" \" dengan Supp "+atur.format(supp)+"% dan Conf "+atur.format(conf)+"% \n");
  
                     conf=(bnyAB/bnyB)*100;
                     if(conf&gt;=Float.parseFloat(jSpinner2.getValue().toString()))
                        jTextArea1.setText(jTextArea1.getText()+" Jika membeli \" "+dt.get(b).getNama_barang()+" \" maka akan membeli \" "+dt.get(a).getNama_barang()+" \" dengan Supp "+atur.format(supp)+"% dan Conf "+atur.format(conf)+"% \n"); 
                 }
             }
          }
      }catch(Exception a){
          System.out.println(a);
      }
      this.revalidate();
  }
  
  
  private void c3(){
      int n=0, m=0, o=0;
      String item1,item2,item3="";
      float bnyABC,bnyAB=0;
      float supp,conf=0;
  
      for (int a=0;a&lt;dt.size();a++){
          n++;
          for(int b=0+n;b&lt;dt.size();b++){
              for(int c=0+b+1;c&lt;dt.size();c++){
                  bnyABC = sql2.c3(dt.get(a).getKode_barang(), dt.get(b).getKode_barang(),dt.get(c).getKode_barang());
                  supp=bnyABC/Integer.parseInt(jTextField1.getText())*100;
  
                  if(supp&gt;=Float.parseFloat(jSpinner1.getValue().toString()))
                  {
                      bnyAB=sql2.c2(dt.get(a).getKode_barang(), dt.get(b).getKode_barang());
                      conf=(bnyABC/bnyAB)*100;
  
                      if(conf&gt;=Float.parseFloat(jSpinner2.getValue().toString()))
                          jTextArea1.setText(jTextArea1.getText()+" Jika membeli \" "+dt.get(a).getNama_barang()+" \" dan \" "+dt.get(b).getNama_barang()+" \" maka akan membeli \" "+dt.get(c).getNama_barang()+" \" dengan Supp "+atur.format(supp)+"% dan Conf "+atur.format(conf)+"% \n");
  
                      bnyAB=sql2.c2(dt.get(a).getKode_barang(), dt.get(c).getKode_barang());
                      conf=(bnyABC/bnyAB)*100;
                      if(conf&gt;=Float.parseFloat(jSpinner2.getValue().toString()))
                          jTextArea1.setText(jTextArea1.getText()+" Jika membeli \" "+dt.get(a).getNama_barang()+" \" dan \" "+dt.get(c).getNama_barang()+" \" maka akan membeli \" "+dt.get(b).getNama_barang()+" \" dengan Supp "+atur.format(supp)+"% dan Conf "+atur.format(conf)+"% \n");
  
                      bnyAB=sql2.c2(dt.get(b).getKode_barang(), dt.get(c).getKode_barang());
                      conf=(bnyABC/bnyAB)*100;
                      if(conf&gt;=Float.parseFloat(jSpinner2.getValue().toString()))
                          jTextArea1.setText(jTextArea1.getText()+" Jika membeli \" "+dt.get(b).getNama_barang()+" \" dan \" "+dt.get(c).getNama_barang()+" \" maka akan membeli \" "+dt.get(a).getNama_barang()+" \" dengan Supp "+atur.format(supp)+"% dan Conf "+atur.format(conf)+"% \n");
                  }
  
              }
          }
      }
  </code></pre>
  
  <p>actionPerformed button to call method:</p>
  
  <pre><code>    private void analisis2BtnActionPerformed(java.awt.event.ActionEvent evt) {                                             
      c2();
      c3();
      }  
  </code></pre>