import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
int w, int h, boolean resizable, boolean ignoreMinSize)
{
+ JFrame extFrame = new JFrame();
+ extFrame.setContentPane(frame);
// TODO: allow callers to determine X and Y position of frame (eg. via
// bounds object).
// TODO: consider fixing method to update entries in the window submenu with
// the current window title
- frame.setTitle(title);
- if (frame.getWidth() < 1 || frame.getHeight() < 1)
+ extFrame.setTitle(title);
+ if (extFrame.getWidth() < 1 || extFrame.getHeight() < 1)
{
- frame.setSize(w, h);
+ extFrame.setSize(w, h);
}
// THIS IS A PUBLIC STATIC METHOD, SO IT MAY BE CALLED EVEN IN
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
if (!ignoreMinSize)
{
- frame.setMinimumSize(
+ extFrame.setMinimumSize(
new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT));
// Set default dimension for Alignment Frame window.
// I did this here in order not to miss out on any Alignment frame.
if (frame instanceof AlignFrame)
{
- frame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH,
+ extFrame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH,
ALIGN_FRAME_DEFAULT_MIN_HEIGHT));
}
}
setKeyBindings(frame);
- desktop.add(frame);
+ // desktop.add(frame);
windowMenu.add(menuItem);
- frame.toFront();
+ extFrame.pack();
+ extFrame.setVisible(true);
+ extFrame.toFront();
try
{
- frame.setSelected(true);
- frame.requestFocus();
- } catch (java.beans.PropertyVetoException ve)
- {
+ extFrame.requestFocus();
} catch (java.lang.ClassCastException cex)
{
jalview.bin.Console.warn(