How to output results in a Jframe
<p>I am currently working on an SJF scheduling program that will output data using GUI. But i am having trouble outputing data to Jframe panel. Help will be appreciated. I want the output of the below mentioned code be displayed on a Jframe.</p>

<pre><code> public static void WTs() {
    int totalWT=0;

  for(int x=1;x&lt;=n;x++)
  {
      WT[x]=BT[x-1]+WT[x-1];
      System.out.print("\nWaiting time for Process" + JB[x] + ":\t" + WT[x]
      + " units \t");
      totalWT= totalWT+ WT[x];
  }
        //////////////////////////2nd output/////////////////////////////
 public static void Display()
      { 

     for(int x=0;x&lt;n;x++)
    {
      System.out.println(" JOB \t" +JB[x]);
      System.out.println(" BURST TIME\t"+BT[x]);

    }
</code></pre>

<p>GUI CODE</p>

<pre><code>    package javaapplication22;
    import javax.swing.JOptionPane;
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextArea;
    import javax.swing.SwingConstants;
public class NewClass extends JFrame {
private final JTextArea item1;
public NewClass(){super("SJF PROJECT ");
setLayout(new FlowLayout());
item1=new JTextArea(" ");
    add(item1);
setLocationRelativeTo(null);

  }
  }
</code></pre>

<p>GUI CODE IN MAIN CLASS</p>

<pre><code>NewClass k= new NewClass();
 k.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 k.setSize(275, 180);
 k.setVisible(true);
 k.setExtendedState(JFrame.MAXIMIZED_BOTH); 

  try {
 Thread.sleep(1000);  
  k.hide();//1000 milliseconds is one second.
  } catch(InterruptedException ex) {
  Thread.currentThread().interrupt();
  }
</code></pre>