[3215] in java-interest

home help back first fref pref prev next nref lref last post

CardLayout and applet repaint()

daemon@ATHENA.MIT.EDU (Suresh Srinivasan)
Fri Nov 3 13:00:04 1995

Date: Fri, 3 Nov 1995 10:32:43 -0500
From: suresh@thomtech.com (Suresh Srinivasan)
To: java-interest@java.sun.com

Hello again,

It appears as though calling an applet's repaint() method does
not call the paint() method of Panels with a CardLayout manager.

Just for kicks, in the GraphicsTest demo, I modified ShapeTest
to be Runnable thus:

    class ShapeTest extends Panel implements Runnable

and added a run() method thus:

    public void run() {
	int i = 0;
	while (thread != null) {
	    System.out.println("Shape: " + shape.toString() + " i: " + i++);
	    applet.repaint();
	    try {thread.sleep(5000); } catch (Exception e) {}
	}
    }

Of course I also pass the applet reference to the constructor so
the repaint can be called from run().  I get the string above in
standard output but my debug in the paint() methods do not show up.

The question is when a repaint is called, I assumed it just called
the individual paint methods for all the embedded components.
If one of the component has a CardLayout layout mgr, do *all* the
cards in it get their paint() methods called?  Or just the top card?
It appears as though neither of this happens..

Thanks in advance for any insight you may have.

--Suresh
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post