title: How to change the location of a JTextArea at run-time?
body: <p>[SOLVED]
  I am using Swing, I have a JPanel and in it there is a JTextArea and a JButton. I want the JTextArea to move when the button is clicked on. I'm Not really sure how to do the action listener for the button. At the moment the JTextArea only moves once when the button is clicked on, but i want it to move every time the button is clicked on. </p>
  
  <p>this is what i have so far:
      <code>x = 20</code>
      <code>moveButton = new JButton("MOVE");</code>
      <code>moveButton.setName("move");</code>
      <code>moveButton.setBounds(20, 140, 70, 40);</code></p>
  
  <pre><code>text = new JTextArea("--&gt;");
  text.setEditable(false);
  text.setBounds(x, 50, 40, 20);
  
  panel.add(moveButton);
  panel.add(text);
  </code></pre>
  
  <p>In the actionPerformed method this is what it does:</p>
  
  <pre><code>text.setBounds(x + 50, 50, 40, 20);
  panel.add(text);
  text.setVisible(true);
  </code></pre>
  
  <p>any help is greatly appreciated.</p>
  
  <p>I have also posted this question on: <a href="http://www.java-forums.org/swing-codes/85365-how-change-location-jtextarea-run-time.html" rel="nofollow"> Java-Fourms</a></p>