- Powered by Domino 8.5.2 Domino Accelerator Pack
- DAP know which URLs slow down your site. Do you?
Lotus Triple Search DominoExperts + Blogs + R8 forum -> Script vault -> Java

 Swing in Lotus Notes agents

dicklarssonPost date: 2007-03-01 15:40

Much nicer interface!

First of all, be aware, creating graphical user interfaces is not the recommended.
But it is possible.

We ask the user for text that will be stored in a new document in the current database.

import lotus.domino.*;
import javax.swing.*;

public class JavaSwing extends AgentBase {
 // Author: Dick Larsson,, +46(0)706-33 23 68
 public void NotesMain() {

  try {
   Session session = getSession();
   AgentContext agentContext = session.getAgentContext();
   Database db = agentContext.getCurrentDatabase();
   int answer = -1;
   String subject = null;
   while (answer != 0) {
    subject = JOptionPane.showInputDialog("Enter subject");
    answer = JOptionPane.showConfirmDialog(null, "Is this correct "
      + subject + " as subject?");
   JOptionPane.showMessageDialog(null, "Thank you");

   Document doc = db.createDocument();
   doc.replaceItemValue("Subject", subject);, true);

  } catch (Exception e) {

RSS feed
Subscribe to Forum

Share this page

Top posters
Tomas Nielsen212
Joacim Boive27
Fredrik Stöckel27
Niklas Waller13
Kenneth Haggman11
Bryan Kuhn10
Daniel Lehtihet9
Jonas Israelsson8