* case where the UI is that of an applet.
*/
public static Window findActiveWindow() {
Window wdw = null;
IMainUI ui = Mediator.getUI();
if (ui != null) {
if (ui.getUiType() == UIType.DESKTOP) {
if (Window.getWindows().length > 0) {
for (Window window : Window.getWindows()) {
if (window.isActive()) {
wdw = window;
break;