title: Java calculator add numbers to textfield
body: <p>I am making a calculator to test my skills in java. How can make the numbers to show up in the jTextfield until i pressed  one button to calculate the numbers;   i want every numbers to show up in the textfield.  for example if i pressed 1 and zero i want the textfield to have 10.</p>
  
  <pre><code>int num;
  JTextField in = new JTextField(20); // input field where numbers will up;
  
  public void actionPerformed(ActionEvent e) {
      if (e.getSource() == bouttons.get(0)) {
          num = 0;
          in.setText("" + num);
      }
      if (e.getSource() == bouttons.get(1)) {
          int num = 1;
          in.setText("" + num);
      }
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/XVm8J.png" rel="nofollow">The screenshot</a></p>