From 7e7191381f57bf0db3b55aa5c3c080dfad17fef0 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 14 Sep 2005 15:42:45 +0000 Subject: [PATCH] Make new frame selected --- src/jalview/gui/Desktop.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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) + {} } /** -- 1.7.10.2