Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.17 seconds.

  1. Replies
    11
    Views
    2,040

    Re: Points in a JPanel

    You're going to have to throw together an SSCCE that demonstrates exactly what you're doing then.
  2. Replies
    11
    Views
    2,040

    Re: Points in a JPanel

    What are h and w supposed to represent? Height and width, right? If so, 10 x 10 is pretty small, since those values are pixels. Also, they shouldn't be fluctuating unless you're resizing your JPanel,...
  3. Replies
    11
    Views
    2,040

    Re: Points in a JPanel

    Did the print statements make sense? Did they print out the correct width and height?

    Also, I'd recommend using fillOval() instead of drawLine() to draw a point.
  4. Replies
    11
    Views
    2,040

    Re: Points in a JPanel

    The problem isn't with those lines, it's with how you're calculating w and h in the first place. I'd throw some print statements in there to double-check your calculations.
  5. Replies
    11
    Views
    2,040

    Re: Points in a JPanel

    I'd check your math with the insets. Trace through it with some example heights, widths, and insets and see what comes out. I'm not even sure why you're dealing with insets since your component...
  6. Replies
    11
    Views
    2,040

    Re: Points in a JPanel

    You're going to have to be more specific than that. What exactly do you mean when you say it doesn't work? Does it only draw a single point? Does it draw too many? Does it draw different points than...
Results 1 to 6 of 6