Does anybody know how to print a messange on the client status bar using Java?

I have a java agent that must print some status messages on the client status bar.

I have tried use:

import lotus.domino.*;

import java.io.PrintWriter;

public class JavaAgent extends AgentBase {

public void NotesMain() {

try {

Session session = getSession();

AgentContext agentContext = session.getAgentContext();

PrintWriter pw = getAgentOutput();

pw.println(“Teste Teste”);

} catch(Exception e) {

e.printStackTrace();

}

}

}

But it prints the messanges on the Java debug console.

Any ideas are very welcome.

Thanks

Santiago

Subject: What does this do (seen in Designer help)?

System.out.println(“Your text here”);

Subject: RE: What does this do (seen in Designer help)?

It works like the:

PrintWriter pw = getAgentOutput();

pw.println(“Teste Teste”);

It prints on Java debug console, but does not print on the status bar, even if the Java debud is turned off.

Subject: May I suggest an alternative?

I find most Notes users don’t pay attention to their status bar anyway, so why not just display a simple message box dialog?

First, the appropriate import:

import javax.swing.*;

Then when you need it, you can use:

JOptionPane.showMessageDialog(null, “Your Message Here!”);

Only downside is that the user must click OK.

Subject: RE: May I suggest an alternative?

Thanks William. It is a good suggest and works fine. But I still want to use the status bar.

My first agent is a Lotus Script agent that retrives around 3.000 data from a db2 and it takes some time (about 20 minutes), because for each data I need to do a validation and create a notes document. So I use the status bar to show the progress. My customer likes it.

I have a second agent, a java agent, that works on each document document created from the first agent (I need to retrieve some more information for each document using some Java classes) and it takes some time too. So, my customer asked to show the progress on status bar like the first agent.

That’s the reason I need to use the status bar.

I’m thinking to use the Java console to show the progress of the agent, but I didn’t find out how to enable the Java console from my agent code.

Subject: RE: May I suggest an alternative?

It’s not all that difficult to display a progress bar in a separate window – spawn a separate thread for the window, and have your main thread send signals to update the status display and and close the window when you’re done. I’m sure there are dozens of free progress bar classes on the internet that you could use.

Subject: Great Idea

I’ve never done in anything with Java progress bars before – Sun’s java web site has some excellent tutorials on using them.