From: amwaterhouse Date: Wed, 14 Sep 2005 15:42:45 +0000 (+0000) Subject: Make new frame selected X-Git-Tag: Release_2_05b~17 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7e7191381f57bf0db3b55aa5c3c080dfad17fef0;p=jalview.git Make new frame selected --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 97c6a20..700b16f 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -119,6 +119,14 @@ public class Desktop extends jalview.jbgui.GDesktop addInternalFrame(frame, "", 750, 160, false); discoverer=new jalview.ws.Discoverer(); // Only gets started if gui is displayed. + + this.addKeyListener(new KeyAdapter() + { + public void keyPressed(KeyEvent k) + { + System.out.println(k); + } + }); } /** @@ -178,10 +186,6 @@ public class Desktop extends jalview.jbgui.GDesktop frame.setLocation(xOffset * openFrameCount, yOffset * ((openFrameCount-1)%10)+yOffset); } - desktop.add(frame); - frame.toFront(); - - final JMenuItem menuItem = new JMenuItem(title); frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { @@ -211,6 +215,13 @@ public class Desktop extends jalview.jbgui.GDesktop }); windowMenu.add(menuItem); + + desktop.add(frame); + frame.toFront(); + try{ + frame.setSelected(true); + }catch(java.beans.PropertyVetoException ve) + {} } /**