You're going to have to throw together an SSCCE that demonstrates exactly what you're doing then.
Type: Posts; User: KevinWorkman
You're going to have to throw together an SSCCE that demonstrates exactly what you're doing then.
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,...
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.
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.
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...
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...