Search:

Type: Posts; User: GregBrannon

Search: Search took 0.10 seconds.

  1. Re: Help with checking to see which menuItem has been selected

    Okay. For completeness, I modified the demo to include two objectives: show how a shape object can draw itself on a Graphics object passed to it, AND how the variables in one class can be updated by...
  2. Re: Help with checking to see which menuItem has been selected

    Point taken, but the construction is for convenience in posting and could be broken apart as needed. I think the demo achieves its purpose which is to show how Shape/Circle/Square (all separate...
  3. Re: Help with checking to see which menuItem has been selected

    Here's a simple demo to show how shapes can draw themselves on a Graphics object based on the shape chosen with a button and the value of a slider, though I'm not sure you care any more. I can't...
  4. Re: Help with checking to see which menuItem has been selected

    Did the results change when the semicolon was removed?
  5. Re: Help with checking to see which menuItem has been selected

    Will do. Sometime today, but I can't promise when. When you make a statement like:

    include code, even a line or two, to show what you tried. You may have done it completely wrong, in the wrong...
  6. Re: Help with checking to see which menuItem has been selected

    No. You pass the Graphics object to the shape's draw method from inside the paintComponent() method of the component on which the drawing is being done, and the shape draws itself on that object.
    ...
  7. Re: Help with checking to see which menuItem has been selected

    Did you consider using instanceof?

    But I think I've given you this advice before: Each shape should know how to draw itself, so simply specifying thisShape.draw() with the necessary parameters,...
Results 1 to 7 of 7