|
|
|
各位 : <br>我想请教一下,我在java库里写了一段代码,如下 :<br>
import lotus.notes.*;<br>
import java.awt.event.*;<br>
import java.awt.*;<br>
<br>
public class SendMemo extends Frame implements ActionListener <br>
{<br>boolean didInit=false;<br>Button b;<br><br>public SendMemo(String title)<br>{<br>super(title);<br>b=new Button("Send memo");<br>b.addActionListener(this);<br>add(b);<br>addWindowListener(new WindowAdapter()<br>{<br>public void windowClosing(WindowEvent evt)<br>{<br>System.exit(0);<br>}<br>});<br>}<br><br>public void actionPerformed(ActionEvent evt)<br>{ <br>if(evt.getSource().equals(b))<br>{<br>try<br>{<br>NotesThread.sinitThread();<br>didInit=true;<br>Session s=Session.newInstance();<br>Registration reg=s.createRegistration();<br>String username=reg.switchToID("C:\\Lotus\\notes\\data\\user.id","lotusnotes");<br>DbDirectory dir=s.getDbDirectory("");<br>Database db=dir.openMailDatabase(s);<br>Document doc=db.createDocument();<br>doc.appendItemValue("Form","Memo");<br>doc.appendItemValue("Subject","hello");<br>doc.appendItemValue("Body","just testing ....");<br>doc.send("admin@sf.com");<br>}<br>catch(NotesException e)<br>{<br>e.printStackTrace();<br>}<br>finally{<br>if(didInit)<br>{<br>NotesThread.stermThread();<br>}<br>}<br>}<br>}<br>public static void main(String[] args)<br>{<br>SendMemo app=new SendMemo("SendMemo");<br>app.setSize(200,100);<br>app.setVisible(true);<br>}<br>
}<br>
<br>
而且编译成功了,但是我不知道通过什么调试或其他设置来显示它的按钮及功能!各位 : <br>我想请教一下,我在java库里写了一段代码,如下 :<br>
import lotus.notes.*;<br>
import java.awt.event.*;<br>
import java.awt.*;<br>
<br>
public class SendMemo extends Frame implements ActionListener <br>
{<br>boolean didInit=false;<br>Button b;<br><br>public SendMemo(String title)<br>{<br>super(title);<br>b=new Button("Send memo");<br>b.addActionListener(this);<br>add(b);<br>addWindowListener(new WindowAdapter()<br>{<br>public void windowClosing(WindowEvent evt)<br>{<br>System.exit(0);<br>}<br>});<br>}<br><br>public void actionPerformed(ActionEvent evt)<br>{ <br>if(evt.getSource().equals(b))<br>{<br>try<br>{<br>NotesThread.sinitThread();<br>didInit=true;<br>Session s=Session.newInstance();<br>Registration reg=s.createRegistration();<br>String username=reg.switchToID("C:\\Lotus\\notes\\data\\user.id","lotusnotes");<br>DbDirectory dir=s.getDbDirectory("");<br>Database db=dir.openMailDatabase(s);<br>Document doc=db.createDocument();<br>doc.appendItemValue("Form","Memo");<br>doc.appendItemValue("Subject","hello");<br>doc.appendItemValue("Body","just testing ....");<br>doc.send("admin@sf.com");<br>}<br>catch(NotesException e)<br>{<br>e.printStackTrace();<br>}<br>finally{<br>if(didInit)<br>{<br>NotesThread.stermThread();<br>}<br>}<br>}<br>}<br>public static void main(String[] args)<br>{<br>SendMemo app=new SendMemo("SendMemo");<br>app.setSize(200,100);<br>app.setVisible(true);<br>}<br>
}<br>
<br>
而且编译成功了,但是我不知道通过什么调试或其他设置来显示它的按钮及功能! |
|