Richard Pajerski Software development and consulting

LS2J as an applet replacement

by Richard Pajerski


Posted on Thursday May 30, 2024 at 10:50PM in Technology


I'm currently reviewing LS2J as an alternative for replacing a number of custom Notes applets I've deployed over the years.  The applets have been very reliable and effective in areas where Notes is typically not that strong such as displaying and editing tabular data.  But with applets' deprecation in Java and their "broken" status in Notes 64-bit versions, I need a viable transition to something that can preserve the existing functionality/investment as much as possible.

Although I don't see any obvious way to embed top-level Java windows (JFrame, JDialog) in the same manner as applets (which can be placed on a form like most other widgets), with LS2J I've found I can call them from behind a simple button and in the case of JDialog, even block the Notes client without breaking things too badly.  I can also call a JFrame from LS2J but the window can quickly lose focus -- in the same way it does when called from a Java agent.  I believe this is due to it being launched on a separate thread.

Below is a contrived example with JDialog but so far so good;  I'm able to replace a form-based applet with a simple button that calls a JDialog, blocks for user input and then transfers the text back to Notes:


This is actually simpler than applets which require Javascript when transferring to/from Notes UI documents (not pleasant).

Our button code (Options):

Click function:

And our associated Script Library:

The JDialog class is a bit more involved but not important in the context of this post.  The important part consists of returning the contents of a JTextArea when "OK" is clicked:

public String getFieldData() {
    return jTextArea1.getText();

 }

And that's it!



Comments:

Hi, nice :-) I have been using Java Swing in Notes clients for many years, which given me UI options I do not have in the Notes Client. As a work around to issue of JFrame hiding behind the the Notes Client, i user a timer which brings the dialog to front at an interval. /Jesper Kiaer

Posted by Jesper Kiaer on May 31, 2024 at 03:56 AM EDT #


Interesting way of doing this, have you tried in in version 12 and 14?

Posted by Fredrik Norling on May 31, 2024 at 05:56 AM EDT #


Hi Jesper -- thanks for your comments! That's a clever workaround with the timer! I agree with you on the advantages of Swing in Notes and it's helped me make the business case for Notes/Domino in projects that would have otherwise left the platform.

Posted by Richard Pajerski on May 31, 2024 at 06:34 AM EDT #


Hi Fredrik - thanks for your comments! I've only tried this in Notes 14, FP1 so far but I do have LS2J running in a production 32-bit R12 client environment (although without any Swing components).

Posted by Richard Pajerski on May 31, 2024 at 06:35 AM EDT #


Leave a Comment

HTML Syntax: Allowed