[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] RFC: java.awt.DefaultKeyboardFocusManager fix
From: |
Roman Kennke |
Subject: |
Re: [cp-patches] RFC: java.awt.DefaultKeyboardFocusManager fix |
Date: |
Wed, 29 Jun 2005 22:44:49 +0200 |
Am Mittwoch, den 29.06.2005, 15:28 -0400 schrieb Thomas Fitzsimmons:
> 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.
I have seen something similar for components that are placed in a window
that is temporarily hidden. I thought I somehow fixed this at that time,
this might be another case where something similar (but not equal)
happens.
/Roman