I don’'t understand why, please hints anyone.
The stack
Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
at TextDemo.sendMessage(TextDemo.java:102)
at TextDemo.access$0(TextDemo.java:100)
at TextDemo$2.actionPerformed(TextDemo.java:84)
My methods looks like
private void sendMessage() {
try {
Chat newChat = connection.createChat("admin@flashjabber.kicks-ass.net/Exodus");
newChat.sendMessage(“hello world”);
} catch (XMPPException e) {
// TODO Auto-generated catch block
//text.append(e.getMessage());
}
}
which is called from
textField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
String text = new String();
text = textField.getText();
System.out.println(“actionPerformed()” + e.getActionCommand() + “\r”);
System.out.println(“line 73” + text);
sendMessage();
// Make sure the new text is visible, even if there
// was a selection in the text area.
textArea.setCaretPosition (textArea.getDocument ().getLength ());
}
});
}