ayce General User

Joined: 27 Nov 2009 Posts: 14
|
Posted: Thu Dec 03, 2009 2:03 am Post subject: Events with Java using UNO |
|
|
Hi guys,
I searched an searched but can not solve my problem.
I did create a new Addon project with Netbeans for OpenOffice 3.1.1.
I just want to add an event listener to catch "save" and "close" events. Everything I need is a working example how to implement it.
Can anyone help me? I getting confused. Thanks.
greetings,
ayce |
|
ayce General User

Joined: 27 Nov 2009 Posts: 14
|
Posted: Thu Dec 03, 2009 3:00 am Post subject: |
|
|
Ok, I got it
JAVA | Code: | document.addEventListener(new com.sun.star.document.XDocumentEventListener() {
public void documentEventOccured(DocumentEvent arg0) {
JOptionPane.showMessageDialog(null, "test: document added" , "listener", JOptionPane.INFORMATION_MESSAGE);
}
public void disposing(EventObject arg0) {
JOptionPane.showMessageDialog(null, "test: document removed" , "listener", JOptionPane.INFORMATION_MESSAGE);
}
}); |
|
|