>> I'm not sure why but take out the super.paint() and it will work fine.
>
[quoted text clipped - 10 lines]
>
> Does anyone have any other ideas or suggestions?

Signature
Knute Johnson
email s/nospam/knute/
> The problem is that paint() only gets called once on a JApplet. I don't
> think it was ever intended that you draw on the JApplet and have
> components on it at the same time. If you want to do both, use a plain
> Applet. It will work just fine.
Neing new to Java, I want to make sure I understand ... on repaint, the
superclass (applet's) paint() gets called, not the JApplet's paint().
Is that right?
That would explain my problem.
Do you have a URL or some other reference that explains what method gets
called to repaint a JApplet?

Signature
Real Estate in '07: "It's dead, Jim."
Knute Johnson - 18 Feb 2007 21:00 GMT
>> The problem is that paint() only gets called once on a JApplet. I
>> don't think it was ever intended that you draw on the JApplet and have
[quoted text clipped - 3 lines]
> Neing new to Java, I want to make sure I understand ... on repaint, the
> superclass (applet's) paint() gets called, not the JApplet's paint().
I don't know if that is true. I don't think it is.
> Is that right?
>
> That would explain my problem.
>
> Do you have a URL or some other reference that explains what method gets
> called to repaint a JApplet?
No I don't. I can tell you though that mixing painting and components
on a JApplet will be problematic. If you want to draw on something just
put a JPanel in to draw on. I believe that the JApplet is just there to
have a lightweight container so that you can use swing components in an
applet.

Signature
Knute Johnson
email s/nospam/knute/
Z - 18 Feb 2007 22:44 GMT
>> The problem is that paint() only gets called once on a JApplet. I
>> don't think it was ever intended that you draw on the JApplet and have
>> components on it at the same time. If you want to do both, use a
>> plain Applet. It will work just fine.
> Being new to Java, I want to make sure I understand ... on repaint, the
> superclass (applet's) paint() gets called, not the JApplet's paint().
> Is that right?
> That would explain my problem.
> Do you have a URL or some other reference that explains what method gets
> called to repaint a JApplet?
http://java.sun.com/docs/books/tutorial/uiswing/painting/problems.html
Ok, I think I've got it now... the "Painting Problems" page reads:
Problem: The background of my applet shows up, but the foreground stuff
doesn't show up.
Did you make the mistake of performing painting directly in a JApplet
subclass? If so, then your contents will be covered by the content pane
that is automatically created for every JApplet instance. Instead,
create another class that performs the painting and then add that class
to the JApplet's content pane.
So ...
1. I removed the paint() method from my JApplet class
2. I created a new class (Repainter), a subclass of JComponent, with a
paintComponent() method and put my g.drawString() calls in that method
3. in my JApplet's init(), I instantiated a Repainter and used a call to
this.getContentPane().add() to add the Repainter to my JApplet's Content
Pane
It seems to be repainting correctly now, under all circumstances.
Did I do this correctly?
Knute Johnson - 19 Feb 2007 00:00 GMT
>>> The problem is that paint() only gets called once on a JApplet. I
>>> don't think it was ever intended that you draw on the JApplet and
[quoted text clipped - 35 lines]
>
> Did I do this correctly?
Sounds good to me. I normally just use a JPanel because the constructor
has parameters for LayoutManager and double buffering but to each his own.

Signature
Knute Johnson
email s/nospam/knute/