frame.setLayer(JLayeredPane.PALETTE_LAYER);
frame.setLocation((int) ((getWidth() - 750) / 2),
(int) ((getHeight() - 160) / 2));
+
addInternalFrame(frame, "", 750, 160, false);
discoverer=new jalview.ws.Discoverer(); // Only gets started if gui is displayed.
* @param w DOCUMENT ME!
* @param h DOCUMENT ME!
*/
- public static void addInternalFrame(final JInternalFrame frame,
+ public static synchronized void addInternalFrame(final JInternalFrame frame,
String title, int w, int h)
{
addInternalFrame(frame, title, w, h, true);
* @param h DOCUMENT ME!
* @param resizable DOCUMENT ME!
*/
- public static void addInternalFrame(final JInternalFrame frame,
+ public static synchronized void addInternalFrame(final JInternalFrame frame,
String title, int w, int h, boolean resizable)
{
}
- desktop.add(frame);
openFrameCount++;
- try
- {
- frame.setSelected(true);
- }
- catch (java.beans.PropertyVetoException e)
- {
- }
-
+ frame.setVisible(true);
frame.setClosable(true);
frame.setResizable(resizable);
frame.setMaximizable(resizable);
if (frame.getX()<1 && frame.getY()<1)
{
- frame.setLocation(xOffset * openFrameCount, yOffset * (openFrameCount%10)+yOffset);
+ frame.setLocation(xOffset * openFrameCount, yOffset * ((openFrameCount-1)%10)+yOffset);
}
- frame.toFront();
+ desktop.add(frame);
+ try
+ {
+ frame.setSelected(true);
+ frame.toFront();
+ }
+ catch (Exception e)
+ {
+ System.out.println("got it " + e);
+ }
+
+
final JMenuItem menuItem = new JMenuItem(title);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
}
catch (java.beans.PropertyVetoException ex)
{
- }
- ;
+ }
}
});
- frame.setVisible(true);
windowMenu.add(menuItem);
}