Patch: java.awt.CardLayout.show fix - was sometimes showing the wrong component

Tom Tromey tromey@redhat.com
Wed Jan 15 22:28:00 GMT 2003


>>>>> "Scott" == Scott Gilbertson <scottg@mantatest.com> writes:

Scott> I've had problems with CardLayout.show showing the wrong
Scott> component.  This patch corrects those problems. I've
Scott> re-structured things a little in CardLayout, which I think
Scott> makes it clearer.

Agreed.  I'm checking this in to the 3.3 branch, the trunk, and
Classpath.

I changed the show() part a bit; I removed the FIXME and added an
early return if the desired target is already visible.  I also fixed a
buglet in gotoComponent by removing these lines:

     else if (what >= 0)
       choice = what;

I don't know why these were there (you didn't add them, so don't worry
:-), but they are pretty clearly wrong.

Tom



More information about the Java-patches mailing list