Search:

Type: Posts; User: GregBrannon

Search: Search took 0.10 seconds.

  1. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    "The right way:" There are many "ways." Some are better than others. Some ways are technically "wrong" but will work anyway, most of the time. Other ways are just plain wrong because they don't...
  2. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    I'll address your comments near the end later when I have more time, about 3 hours from now. In the meantime, please work through this excellent article/tutorial, Performaing Custom Painting. Work...
  3. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    What don't you understand about the working code I posted? Or is that fine, but now you're thinking about the next step? If you're thinking about the next step, let's start with code you understand...
  4. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    Okay. The changes I made are relatively minor but critical to getting it to function as desired. Let me know if you have any questions:

    Main:
    // imports
    import javax.swing.JFrame;
    import...
  5. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    Other thoughts:

    I would add the KeyListener to the Panel instance.

    You should be overriding the paintComponent() method in Panel and not Paint().

    The method names in Keys should begin with...
  6. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    It's good to have the additional detail of your assessment of the problem and how you got there. Since you're having difficulty moving from single class to multi-, do you have the single-class...
  7. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    You shouldn't have to delete anything. Start a new program as a learning exercise to practice the basics required to do one or two specific things: draw an object, make it move. Come here with the...
  8. Replies
    14
    Views
    1,403

    Re: Moving an oval around the frame

    That's a lot of code to practice moving an object around a JPanel. You should write a simple, short example that paints a shape on a JPanel at specific coordinates and then moves around by changing...
Results 1 to 8 of 8