Inheritance - help!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ed_Wallace
Posted On:   Wednesday, August 14, 2002 07:31 AM

Hi, a question. I have an object, lets call it 'Bank', bank creates a JDesktop I have a second object 'SearchFrame', searchframe extends JInternalFrame and implements actionlistener I have a third object call 'HelpFrame' - this is just a mickey mouse obj. Bank instantiates searchframe and places the JInternal frame on the desktop. search frame has a button on it. when the button is pressed I want to call the bank objects 'displayhelp' method - but I cant! how do I call a method in bank from searchframe when search frame does not consider bank to be its superclass? HELP! This has been doing my head in for a day now. Thanks. Ed.    More>>

Hi, a question.

I have an object, lets call it 'Bank', bank creates a JDesktop

I have a second object 'SearchFrame', searchframe extends JInternalFrame and implements actionlistener

I have a third object call 'HelpFrame' - this is just a mickey mouse obj.

Bank instantiates searchframe and places the JInternal frame on the desktop.

search frame has a button on it. when the button is pressed I want to call the bank objects 'displayhelp' method - but I cant!

how do I call a method in bank from searchframe when search frame does not consider bank to be its superclass?

HELP! This has been doing my head in for a day now.

Thanks.
Ed.

   <<Less

Re: Inheritance - help!

Posted By:   Rob_Taft  
Posted On:   Wednesday, August 14, 2002 07:49 AM

You could just pass Bank (this) as a parameter into the searchframe in its constructor. This will give you access to the Bank that constructed it. Its not very clean, but it works.
About | Sitemap | Contact