title: Smooth movement of JButton on an action
body: <p>How can I smoothly move the JButton if action performed (eg the button is pushed). Here's my example but it doesnt work propely: </p>
  
  <pre><code>   public void actionPerformed(ActionEvent event) {
     for(int i = 0; i&lt;50; i++){
            ww.button.setLocation(ww.button.getLocation().x+1, ww.button.getLocation().y);//ww is a JFrame child
        try {
          Thread.sleep(20);
  
      } catch (InterruptedException e) {
          e.printStackTrace();
      }
  
     }
  </code></pre>
  
  <p>After action performed I get a delay in 20*50 ms and button location set in previous loc + 50px, without intermediate locations.</p>