Results 1 to 2 of 2
  1. #1
    rajkobie is offline Member
    Join Date
    Nov 2010
    Posts
    54
    Rep Power
    0

    Default How to stop lagging in a JPanel?

    I draw an image using the paintComponent ( Graphics g ) and do sprite movement using the same method and repaint ( ). Now, the problem is that when i move my sprite it goes then slows down then speeds then slows. Is there a way to stop this lagging?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by rajkobie View Post
    I draw an image using the paintComponent ( Graphics g ) and do sprite movement using the same method and repaint ( ). Now, the problem is that when i move my sprite it goes then slows down then speeds then slows. Is there a way to stop this lagging?
    You've likely got a problem in your code, but can you seriously expect us to be able to help you without our being able to see it?

Similar Threads

  1. Simple Questions- Stop JPanel Blinking
    By MrFish in forum AWT / Swing
    Replies: 7
    Last Post: 04-10-2011, 07:23 PM
  2. Adding a jpanel to a customized Jpanel Class
    By trishtren in forum AWT / Swing
    Replies: 7
    Last Post: 04-05-2011, 07:52 PM
  3. Adding Jpanel ontop of another Jpanel
    By Manfizy in forum AWT / Swing
    Replies: 4
    Last Post: 03-05-2011, 11:34 PM
  4. Placing a new JPanel over a paint overriden JPanel
    By Tanshaydar in forum AWT / Swing
    Replies: 4
    Last Post: 12-08-2010, 07:00 PM
  5. Use stop button to stop moving (stop timers) on JPanel
    By mneskovic in forum New To Java
    Replies: 3
    Last Post: 07-23-2010, 01:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •