Results 1 to 2 of 2
  1. #1
    Scyth3 is offline Member
    Join Date
    Nov 2012
    Rep Power

    Angry Moving objects in paintComponent void

    In my program, I hit the right arrow and the box should move over... However, this is not the case. I can not think of any good way to move this box. I have tried putting a while loop in the paintComponent method that checks for a boolean. Then when I hit the arrow, the boolean becomes true. This does not work. I know why, but I cant fix it. The problem is that when I add the class with the paintComponent void to a JFrame, it only runs through the void once to add graphics. How can I achive my goal?

    If tl;dr. Here is my question in a nutshell.

    I cant get my green box to move. Help.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Replies: 10
    Last Post: 04-05-2012, 09:32 AM
  2. Moving Objects in an circlelair motion.
    By Thomask in forum Java Applets
    Replies: 8
    Last Post: 02-17-2011, 05:23 PM
  3. Moving objects
    By rsjava24 in forum AWT / Swing
    Replies: 1
    Last Post: 02-26-2010, 10:47 AM
  4. Moving objects - setting different speed
    By Antigol in forum Java 2D
    Replies: 2
    Last Post: 08-14-2009, 01:14 AM
  5. examples of moving objects
    By fred in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:06 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