How to make sure a non-modal JDialog appears on top of the Arbortext window

Submitted by: Keith Berard Last Updated: 2006-07-29

We're currently using a small snippet of javascript put in the custom/init dir. It basically looks for any JDialog based windows that appear, and sends them to the front.

importPackage(Packages.java.awt); importPackage(Packages.java.awt.event); importPackage(Packages.javax.swing); //create a function object, required to create java anonymous inner var java_function = {eventDispatched: function (event) { var source = event.getSource; if (source instanceof JDialog){ source.setAlwaysOnTop(true); } }}; var listener = new AWTEventListener(java_function); var toolkit = Toolkit.getDefaultToolkit; toolkit.addAWTEventListener(listener, AWTEvent.PAINT_EVENT_MASK);