Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / January 2004

Tip: Looking for answers? Try searching our database.

JavaBeans - how to get "owner" variable?

Thread view: 
Deeva Tatiana - 23 Jan 2004 11:22 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.