title: how to move jlabel every second?
body: <p>i try to move it to the right(x++) every seconds</p>
  
  <p>i try to  move it with thread..</p>
  
  <ol>
  <li>how to do it? (and can see it move every second)</li>
  <li>there are another way to do it without use thread?</li>
  <li>what layout manager that i should use?</li>
  </ol>
  
  <p>heres i try..</p>
  
  <pre><code>public class help {
      JFrame frame = new JFrame();
      JLabel label = new JLabel("target");
  
      public help() {
          frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          frame.setSize(800,600);
          frame.setLayout(new GridLayout());
          frame.add(label);
          label.setPreferredSize(new Dimension(100,100));
          label.setLocation(400, 300);
  
          frame.getContentPane().validate();
          frame.repaint();
          frame.setVisible(true);
  
          mysterious();
      }
  
      void mysterious(){
       ////////////////////////////////
       // part of edit responding David kroukamp  
      Thread t = new Thread(new Runnable() {
      @Override
      public void run() {
           try{
  
              for (int z=0; z&lt;10; z++){
              label.setLocation((label.getLocationOnScreen().x+10), label.getLocationOnScreen().y);
              Thread.sleep(1000);  
              } 
          }catch(Exception ae){
  
      }
      }
  });
  t.start();
      //////////////////////////////
  
  
  
      }
      public static void main(String[]args){
          new help();  
          }
  }
  </code></pre>
  
  <p>thanks a lot for any kind of help</p>