views:

123

answers:

1

I have created a list of my friends' names. By clicking on their names one frame should get opened for me and a second one on the machine where the friend has the same application running.Just like the chat window in a messenger application. I use the IP address 127.0.0.1 fort this. Will this wor?

this is my list action performed:

private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {                                    

    ChatFrame frame = new ChatFrame(client);
    frame.setVisible(true);

} 
+4  A: 

OK, let me see if I got this straight: you're creating something akin to an IM, right?

And you're using a connection on a port at 127.0.0.1?

As we all know the 127.0.0.1 is a loopback address, it will only point to one's machine. No matter what machine.

IF you're trying to create an IM, you need a server to handle the messages, OR know the remote address you're trying to connect (and a server there could be made to provide such address, that's how Yahoo Messenger does).

Paulo Santos