import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
+import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
+
/**
* Jalview Desktop
*
}
}
});
-
+ this.addFocusListener(new FocusListener()
+ {
+
+ @Override
+ public void focusLost(FocusEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void focusGained(FocusEvent e)
+ {
+ Cache.log.debug("Relaying windows after focus gain");
+ // make sure that we sort windows properly after we gain focus
+ instance.relayerWindows();
+ }
+ });
this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this));
// Spawn a thread that shows the splashscreen
SwingUtilities.invokeLater(new Runnable()
{
jvnews.refreshNews();
jvnews.toFront();
+ // try real hard to get focus when the news is first opened
+ new Thread(new Runnable() {
+ @Override
+ public void run()
+ {
+ while (jvnews.isVisible() && !jvnews.requestFocusInWindow())
+ {
+ try { Thread.sleep(50); } catch (InterruptedException x) {};
+ }
+
+ }
+ }).start();
}
}
}
}
+ /**
+ * fixes stacking order after a modal dialog to ensure windows that should be on top actually are
+ */
+ public void relayerWindows()
+ {
+ if (jvnews!=null && jvnews.isVisible())
+ {
+ jvnews.toFront();
+ }
+ }
+
protected JMenuItem groovyShell;
public void doGroovyCheck()