Hi All!
I am beginner in Java and JavaBeans. Now I have problem (I have a lot of
docs and books, but can't understand how to resolve my problem). (Sorry for
my English).
1-st class is descendant of Object (no Component!), it is non-visible bean
class A ...{...}
2-nd class is descendant of Component, it is visible component (for ex.,
Window or Frame )
class B ...{...}
It may contain one or more class A variables:
// constructor
B (...) {
a1 = new A();
a2 = new class A();
...
}; so, class B is like container for class A variables.
there are also some class B variables : b1, b2...
a1 and a2 catch keyboard events after their B component is shown.
If there are >1 B components are shown:
HOW CAN any variable of class A (b1.a1, b1.a2, b2.a1, b2.a2) GET THE NAME OF
IT's
"CONTAINER" COMPONENT ? i.e. b1.a1, b1.a2 variables -> b1; b2.a1 and
b1.a2 - > b2.
For ex., 4 variables - b1.a1, b1.a2, b2.a1, b2.a2 have got the same
KeyEvent.
b1.a1, b1.a2 have to make some actions only in b1 component;
and b2.a1, b2.a2 - only in b2 component.
KeyEvent.getSource() doesn't resolve this problem, because the source is
focused or modal window, but other A variables get KeyEvents too. How can
they "know", is "their" window activated or modal ?
--
Best regards,
Jana.
Deeva Tatiana - 23 Jan 2004 11:26 GMT
Sorry, there is mistake in my previous letter.
> HOW CAN any variable of class A (b1.a1, b1.a2, b2.a1, b2.a2) GET THE NAME OF
> IT's "CONTAINER" COMPONENT ? i.e. b1.a1, b1.a2 variables -> b1;
> b2.a1 and b1.a2 - > b2.
^^^^^ certainly, b2 here
Best regards,
Jana.