title: JPanel setLocation
body: <p>Where it says: usePanel.setLocation(800,usePanel.getY()); it doesn't set the location it just starts in the middle, but inside the for loop where it gradually changes the position for a cool animation, it works fine.</p>
  
  <p>Any idea why the first set location to get it started isn't working?  This is under FlowLayout btw so I assume that may have something to do with it but am not sure.</p>
  
  <pre><code>        usePanel.setLocation(800,usePanel.getY());
          for(int x=0;x&lt;3500;x+=6){
              usePanel.setLocation(usePanel.getX()-5,usePanel.getY());
              Thread.sleep(500);
          }
  </code></pre>
  
  <p><strong>Updated with current code</strong></p>
  
  <pre><code>private Timer nextloc;
  private JPanel usePanel;
  private static ClosePanel cp = new ClosePanel("null");
  
  public void run(){
      Timer andgo = new Timer(10,new TimerListener());
      while(!cp.getCloseDone()){
          andgo.start();
          andgo.restart();
      }
      if(panel.equals("topiccreator")){
          usePanel=topiccreator;
      }else{
          System.out.println("NULL PANEL TO MOVE!");
          usePanel=mainmenu;
      }
  
              //This is what is not working
      usePanel.setLocation(usePanel.getX()+800,usePanel.getY());
      usePanel.setVisible(true);
  
      nextloc = new Timer(50,new TimerListener());
      for(int r=0;r&lt;3500;r+=6){
          nextloc.start();
          nextloc.restart();
      }
  }
  
  private class TimerListener implements ActionListener{
      public void actionPerformed(ActionEvent e){
          if(e.getSource()==nextloc){
              usePanel.setLocation(usePanel.getX()-5,usePanel.getY());
          }
      }
  }
  </code></pre>