J
Java and Swing
I have a swing app I am working on and I have the following GUI classes
with the given hierarchy:
MainPanel
BuddyListPanel
ChatPanel
LogPanel
MsgPanel
So, MainPanel contains a BuddyListPanel and a ChatPanel. ChatPanel
contains a LogPanel and a MsgPanel.
When MainPanel is created an instance of the ClientModel is given to
it, so that it can register with the model, etc.
Problem is, when someone types a message into the textfield in a
MsgPanel, and clicks the "Send" button the message needs to be
sent out. However, the MsgPanel has no knowledge of who the receiver
of the message is (i.e. the IP address of the buddy receiving the
message, etc).
How can I work this out? I don't want to pass the ClientModel from the
MainPanel to ChatPanel to the MsgPanel...that seems wrong.
Thanks in advance.
with the given hierarchy:
MainPanel
BuddyListPanel
ChatPanel
LogPanel
MsgPanel
So, MainPanel contains a BuddyListPanel and a ChatPanel. ChatPanel
contains a LogPanel and a MsgPanel.
When MainPanel is created an instance of the ClientModel is given to
it, so that it can register with the model, etc.
Problem is, when someone types a message into the textfield in a
MsgPanel, and clicks the "Send" button the message needs to be
sent out. However, the MsgPanel has no knowledge of who the receiver
of the message is (i.e. the IP address of the buddy receiving the
message, etc).
How can I work this out? I don't want to pass the ClientModel from the
MainPanel to ChatPanel to the MsgPanel...that seems wrong.
Thanks in advance.