Chinaunix

标题: 如何调试java库中的代码 [打印本页]

作者: cynthia_liji    时间: 2006-01-11 15:40
标题: 如何调试java库中的代码
各位 :
   我想请教一下,我在java库里写了一段代码,如下 :
import lotus.notes.*;
import java.awt.event.*;
import java.awt.*;

public class SendMemo extends Frame implements ActionListener
{
        boolean didInit=false;
        Button b;
       
        public SendMemo(String title)
        {
         super(title);
         b=new Button("Send memo");
         b.addActionListener(this);
         add(b);
        addWindowListener(new WindowAdapter()
         {
           public void windowClosing(WindowEvent evt)
             {
                System.exit(0);
             }
          });
       }
      
        public void actionPerformed(ActionEvent evt)
        {  
         if(evt.getSource().equals(b))
          {
        try
          {
            NotesThread.sinitThread();
            didInit=true;
             Session s=Session.newInstance();
             Registration reg=s.createRegistration();
             String username=reg.switchToID("C:\\Lotus\\notes\\data\\user.id","lotusnotes");
             DbDirectory dir=s.getDbDirectory("");
             Database db=dir.openMailDatabase(s);
             Document doc=db.createDocument();
             doc.appendItemValue("Form","Memo");
             doc.appendItemValue("Subject","hello");
             doc.appendItemValue("Body","just testing ....");
             doc.send("admin@sf.com");
           }
        catch(NotesException e)
           {
            e.printStackTrace();
           }
           finally{
            if(didInit)
              {
                NotesThread.stermThread();
              }
           }
         }
  }
  public static void main(String[] args)
   {
     SendMemo app=new SendMemo("SendMemo");
        app.setSize(200,100);
        app.setVisible(true);
    }
}

而且编译成功了,但是我不知道通过什么调试或其他设置来显示它的按钮及功能!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2