title: Java programming in files , random , GUI
body: <p>I want to write a Java program that reads the data from a file and stores it in an array. And then generates a random array index and uses it to retrieve a random word from the array to display. Each time the user clicks Next button, the program chooses a new random word to be displayed. I'm trying to add buttons in frame but they won't appear on the <code>JFrame</code>. Following is the code I wrote:</p>
  
  <pre><code>okButton = new JButton ("OK");
  Pane.add(okButton);  
  
  nextButton = new JButton ("Next");
  Pane.add(nextButton);
  </code></pre>
  
  <p>When the user enters a right answer I want a <code>JLabel</code> to appear saying <code>" Correct answer "</code>. How do I make a JLabel Appear? and when the user closes the frame all the right answers show in a <code>JTextArea</code>.
  Can you please help me?</p>