On Wed, 2005-06-29 at 15:14 +0200, Jeroen Frijters wrote: > Hi, > > Can someone who is more up to speed with AWT please take a look at the > attached patch? While running some AWT code I got a ClassCastException > in this code and while I didn't quite understand the point of the code > (or why it failed), it looked to me as if the logic was wrong. It tries > to find the toplevel window, but if it doesn't find it, it still goes > ahead and casts the component to a window.
What is the component that is being cast to a window that causes the ClassCastException? This code assumes that target is either a window or packed in a window. If that assumption holds, then the only time that parent == null is when target is a window with a null parent. In this case, the while loop will fall through and toplevel will be assigned target. Maybe a focus event is being delivered to a component that isn't yet packed in a window, or that has just been removed from a window? In any case, I'd be interested to know what components are involved. Tom > > Thanks. > > Regards, > Jeroen > _______________________________________________ > Classpath-patches mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/classpath-patches _______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
