Hello, how is that i can create an object which can be used by the
other classes in my project, so they can use the logging service...
since I have used many classes extending JFrame, and JInternalFrame, i
cannot extend from any other class else... so what would you recommend
to me? using interfaces? (i need implemented code)
Ian Wilson - 16 Jul 2007 16:35 GMT
> Hello, how is that i can create an object which can be used by the
> other classes in my project, so they can use the logging service...
> since I have used many classes extending JFrame, and JInternalFrame, i
> cannot extend from any other class else... so what would you recommend
> to me? using interfaces? (i need implemented code)
I'd pass an instance as a parameter to the constructors of the many
classes. Or to a method written to accept it.
e.g.
MyObject myObj = new MyObject();
MyClass1 mc1 = new MyClass1(myObj);
MyClass2 mc2 = new MyClass2();
mc2.setMyObject(myObj);