title: Why isn't the jumping animation showing?
body: <p>I'm a beginner programmer and I recently started trying to make a game in Java.</p>
  
  <p>It's very basic and doesn't include any classes (although it should) but anyway I tried to make a jumping animation on the <code>JPanel</code> using a <code>JLabel</code> as my sprite but whenever I try to time the space between each movement of the label by using <code>Thread.sleep(millis)</code> the Java seems to skip it and moves the label to the last position.</p>
  
  <pre><code>JFrame frame = new JFrame("malario");
  frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
  
  frame.setVisible(true);
  frame.setSize(700, 700);
  JPanel panel = new JPanel();
  
  panel.setLayout(null);
  panel.setBackground(Color.blue);
  JLabel malario = new JLabel("Malario");
  malario.setOpaque(true);
  malario.setBackground(Color.green);
  panel.add(malario);
  
  malario.setBounds(100, 550, 50, 50);
  
  JLabel platform = new JLabel();
  platform.setOpaque(true);
  platform.setBounds(0,600,700,50);
  panel.add(platform);
  frame.setContentPane(panel);
  frame.addKeyListener(new KeyListener() {
      int originalx = 100;
      int originaly = 550;
      int currentlocx = originalx;
      int currentlocy = originaly;
  
      @Override
      public void keyTyped(KeyEvent e) {
      }
  
      @Override
      public void keyReleased(KeyEvent e) {
          // TODO Auto-generated method stub
      }
  
      @Override
      public void keyPressed(KeyEvent e) {
  
          if(e.getKeyCode()==KeyEvent.VK_RIGHT){
              malario.setBounds(currentlocx+10,currentlocy , 50, 50);
              currentlocx = currentlocx+10;
          }
  
          if(e.getKeyCode()==KeyEvent.VK_LEFT){
              malario.setBounds(currentlocx-10,currentlocy , 50, 50);
              currentlocx = currentlocx-10;
          }
          int jumpy=0;
          if(e.getKeyCode()==KeyEvent.VK_UP){
              jumpy= currentlocy-100;
              while(jumpy!=currentlocy){
  
                  malario.setBounds(currentlocx,currentlocy-10 , 50, 50);
                  try {
                      Thread.sleep(1);
                  } catch (InterruptedException e1) {
                      // TODO Auto-generated catch block
                      e1.printStackTrace();
                  }
                  currentlocy = currentlocy-10;
              }
          }
      }
  });
  
  }
  public static int Time(){
      return (int)System.currentTimeMillis();
  }
  } 
  </code></pre>