you see, all my application defined classes are declared in the 'main' clas

hi there,

class MainClass

{

class other1;

class other2;

...

public void main(...)

}

other1 needs other2, other2 needs other3 and so on..,

so you see, for instance i'm inside other2's function, from within, i need to use other1

ie,

class other1

{

public void afunction()

{

// needs other2

}

}

so what do i do? should i just create a paramter for other1 that accepts the mainclass so i could access the classes?

okey if you can't help there maybe you can help me here, another problem

i 'need' to extend from jtextpane(due to drag and drop), but i want to remove all the access on jtextpane's functions coz i'll be the one to provide the functions, how? in c++, we can do private inheritance can it be done here?

[851 byte] By [mickeyRENa] at [2007-9-28 11:26:57]
# 1
> but i want to remove all the access on jtextpane's functions coz i'll be the one to > provide the functions, how? in c++, we can do private inheritance can it be done > here?Do not use inheritance, use another pattern like delegation.
BIJa at 2007-7-12 2:01:51 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
Looks like you need Mediator pattern from GOF design pattern ... ;)
lexzeusa at 2007-7-12 2:01:51 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
What about the decorator pattern? To me it looks like adding responsibilities to an object dynamically.
phanaea at 2007-7-12 2:01:51 > top of Java-index,Other Topics,Patterns & OO Design...