Hi, I could not get receive message, somebody can tell me, what happle???
public class Frame1
extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
XMPPConnection connection = null;
public Frame1() {
try {
jbInit();
d();
}
catch (Exception exception) {
exception.printStackTrace();
}
}
private void d() {
try {
XMPPConnection.DEBUG_ENABLED = true;
SSLXMPPConnection.DEBUG_ENABLED = true;
connection = new XMPPConnection(“127.0.0.1”);
connection.login(“XXX”, “XXX123”);
PacketFilter filter = new PacketTypeFilter(Message.class);
PacketListener listener = new PacketListener() {
public void processPacket(Packet packet) {
Message message = (Message) packet;
if(packet instanceof Message){
System.out.println(“SSSSS”);
}
}
};
connection.addPacketListener(listener, filter);
connection.sendPacket(new Presence(Presence.Type.AVAILABLE));
}
catch (XMPPException ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(borderLayout1);
}
public static void main(String[] args) {
Frame1 frame1 = new Frame1();
frame1.pack();
}
}