title: Image of showInputDialog box stuck on JFrame
body: <p>So I'm just starting GUI stuff with Java in my class and I'm getting a weird problem. For personal practice I wanted to make a simple kind of "spreadsheet" application. Right now I'm just trying to get it to display the column names. It does that but there's like an image of my JOptionPane.showInputDialog popup box.</p>
  
  <p>Here are my three classes:</p>
  
  <p>JPanel.java:</p>
  
  <pre><code>import java.awt.Color;
  import java.awt.Font;
  import java.awt.Graphics;
  
  import javax.swing.JOptionPane;
  import javax.swing.JPanel;
  
  public class Panel extends JPanel{
  
      private Spreadsheet SprdSht;
      public Panel(Spreadsheet sprdSht){
          SprdSht = sprdSht;
      }
  
      public Panel(){
           SprdSht = new Spreadsheet(0,0);
  
      }
  
      public void paintComponent(Graphics thing){
  
          super.paintComponent(thing);    
          int width = getWidth();
          int height = getHeight();
  
          String temp[] = new String[100];
  
          for(int x = 0; x&lt;SprdSht.getCols(); x++){
              temp[x] = JOptionPane.showInputDialog("Column " + (x+1) + " name?");
          }
  
          for(int x = 0; x&lt;SprdSht.getCols(); x++){
  
              thing.drawString(temp[x], x*50+5, 15);      
          }    
      }
  }
  </code></pre>
  
  <p>TestSpreadsheet.java:</p>
  
  <pre><code>import javax.swing.JFrame;
  import javax.swing.JOptionPane;
  
  public class TestSpreadsheet {
      public static void main(String args[]){
          try{
              String numColumnsStr = JOptionPane.showInputDialog("Number of columns?");
              int  numColumns = Integer.parseInt(numColumnsStr);
              String numRowsStr = JOptionPane.showInputDialog("Number of rows?");
              int  numRows = Integer.parseInt(numRowsStr);
              Spreadsheet sprdSht = new Spreadsheet(numColumns,numRows);
  
  
              Panel tempGradePanel = new Panel(sprdSht);      
              JFrame tempFrame = new JFrame();
              tempFrame.setDefaultCloseOperation(3);
              tempFrame.add(tempGradePanel);
              tempFrame.setSize(500, 500);
              tempFrame.setVisible(true);     
         }    
          catch (Exception exc){
            JOptionPane.showMessageDialog(null, "Bad response, closing program.");
          }       
      }           
  }
  </code></pre>
  
  <p>Spreadsheet.java:</p>
  
  <pre><code>public class Spreadsheet {
  
      private int Columns;
      private int Rows;
  
      public Spreadsheet(int cols, int rows){
          Columns=cols;
          Rows=rows;      
      }
  
      public int getCols(){
          return Columns;
      }
      public int getRows(){
          return Rows;
      }   
  }
  </code></pre>
  
  <p>And I get this after inputing 2 for #columns, 1 for #rows, "column1" for column 1 name, and "column2" for column 2 name:
    <a href="http://i.stack.imgur.com/ykQrz.png" rel="nofollow">http://i.stack.imgur.com/ykQrz.png</a></p>