try { last_selected = (JSLFrame.JSLJFrame)e.getJSLFrame().getJFrame(); } catch (Exception ex) { last_selected = null; }
JSLFrame f = e.getJSLFrame(); if (f != toolbar  && !f.isIcon() && !f.isClosing()) last_selected = (JSLFrame.JSLJFrame) f.getJFrame();
	public void JSLFrameDeactivated(JSLFrameEvent e) {	    try {		last_selected = (JSLFrame.JSLJFrame)e.getJSLFrame().getJFrame();	    } catch (Exception ex) {		last_selected = null;	    }	}