<Swing Dev> redefenition isValid() method from Component
sablintolya at gmail.com
sablintolya at gmail.com
Fri Jan 7 10:47:58 UTC 2011
> > And if I run this code under openjdk it shows panel with label, but if
>
> I run
>
> > this code under propriertary sunjdk it shows panel without label.
> >
> > If comment isValid() method, it works equally.
> >
> > Why such a difference and who is working correctly?
>
> Both are working correctly but the Sun/Oracle one has an optimization
> (since 6u10 or so) that it doesn't validate the component if it is valid
> while the previous version apparently called validate (thus layouts the
> label) at least once without checking isValid().
>
> Don't override is valid to return true if your component isn't valid :).
>
> Walter.
Thanks :)
With regards, Anatoliy
More information about the swing-dev
mailing list