Re: Concentric Circles Loosing It

From: Anthony Borla (ajborla_at_bigpond.com)
Date: 12/07/03


Date: Sun, 07 Dec 2003 11:30:13 GMT


"Kanga_Sue" <Kanga_Sue@yahoo.co.uk> wrote in message
news:d78e3e0.0312070028.18983ed7@posting.google.com...
>
> I'm new to Java (distance learning) and struggling with
> a question in my first assignment.
>

Just out of curiosity, is the course an introduction to programming, or an
introduction to Java, one assuming previous programming experience ? If the
former, I'm surprised to know applets and graphics [even basic graphics] are
being taught. I would have thought console-based applications more
appropriate for such a course.

>
> I have to draw 3 concentric circles, prompting the user to input
> a radius. I've managed that, managed to get the 3 circles centered,
> however, when I minimise and maximise the Applet,
> the circles get smaller and smaller.
>

It sounds as if the value of the radius is being decremented each time the
applet is being repainted, something which happens, naturally enough, when
visual aspects of the applet change e.g. minimised, maximised, uncovered
after being obscured by another window.

If so, the remedy is to ensure this value remains fixed after having been
input.

>
> I'm at a lost, been trying to figure it out for about a month
> now. I have one class prompting the user for the radius
> and then passing the values to another class to actually draw
> the circles. I probably haven't phrased this right, but any
> help at this point would be greatly appreciated.
>

If the circles are being correctly drawn initially, then you know the radius
value is being correctly accepted and passed to the 'drawing' class. After
that, though, it is being systematically decremented.

Start inspecting your code :) !

I hope this helps.

Anthony Borla



Relevant Pages

  • Re: Concentric Circles Loosing It
    ... I'm a newbie Java student as well, and AFAIK we all start the same way -> by ... >> however, when I minimise and maximise the Applet, ... >> the circles get smaller and smaller. ... I have one class prompting the user for the radius ...
    (comp.lang.java.help)
  • Re: More confused than ever. Please give me a hint.
    ... > problems to use again Java. ... > Error loading class: Circles ... simple to use the Sun plugin as the handler for <applet> tags. ... which are in a format it does not recognize. ...
    (comp.lang.java.programmer)
  • More confused than ever. Please give me a hint.
    ... Five years ago I used Microsoft java 1.2 for about one year to build complex ... Web Services Developer Pack 1.3 (couldn' install 1.4), I am not able to run ... the following test applet locally on my computer (source is not mine - I ... Error loading class: Circles ...
    (comp.lang.java.programmer)
  • Newbie question
    ... Five years ago I used Microsoft java 1.2 for about one year to build complex ... Web Services Developer Pack 1.3 (couldn' install 1.4), I am not able to run ... the following test applet locally on my computer (source is not mine - I ... Error loading class: Circles ...
    (comp.lang.java)
  • Re: converting points to circles
    ... > we need to transform points in Oracle spatial to circles with a ... > given radius in Oracle spatial. ... GEOMETRY SDO_GEOMETRY ... CREATE OR REPLACE FUNCTION Point2Circle( ...
    (comp.databases.oracle.misc)