Originally posted by Brian Cole:
I haven't actually run your code, but I would guess that it's the
normal limitations of the double type that java (and many
other languages) uses. There are some values that it just can't
represent, and 123456789111 is one of them. If you don't like
this, you could try using BigDecimal instead.
While I'm here, allow me ask a couple things about your code:
1) Why bother to use String variables b0, b1, etc? (I would just use
the String literals "0", "1", etc. but if you really want to use those
variables, perhaps you should declare them to be static final.)
2) Is there a reason you're doing setLayout(null) and manually
calling setBounds() on everything?
Originally posted by Mark Vedder:
OK - I see the problem:
The drawing panel is getting added on top of the button and is therefore covering it up. If you look at the frame when it runs, you will see a small black stripe at the bottom. That's the MyDrawPanel. Change the code so the panel is added to the CENTER:
Was that just a typo on your part (which we've all done) or is it wrong in the book?
Originally posted by Ernest Friedman-Hill:
Now, as to your question: you should be able to remove the getRadius() method entirely without having any effect on this program, since no code here calls that method. It doesn't matter what a method does if it never gets called! Yeah, I was able to remove it now without a problem unlike yesterday. It's an error on my part. Sorry po.
The getRadius() method asks for the value stored in the radius divider. It could be used like
double radius = aCircle.getRadius();
Is this helping at all?