Java Code Examples for javax.swing.JInternalFrame#toFront()

The following examples show how to use javax.swing.JInternalFrame#toFront() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestViewer.java    From sis with Apache License 2.0 6 votes vote down vote up
/**
 * Creates and shows a new internal frame for the given image.
 */
private void addImage(final RenderedImage image, final String title) {
    final JInternalFrame internal = new JInternalFrame(title, true, true);
    internal.add(new ImagePanel(image));
    internal.pack();
    internal.show();
    desktop.add(internal);
    if (location > min(desktop.getWidth()  - internal.getWidth(),
                       desktop.getHeight() - internal.getHeight()))
    {
        location = 0;
    }
    internal.setLocation(location, location);
    location += 30;
    internal.toFront();
}
 
Example 2
Source File: GuiUtil.java    From jts with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Workaround for bug: can't re-show internal frames. See bug parade 4138031.
 */
public static void show(JInternalFrame internalFrame, JDesktopPane desktopPane)
    throws PropertyVetoException {
    if (!desktopPane.isAncestorOf(internalFrame))
        desktopPane.add(internalFrame);
    internalFrame.setClosed(false);
    internalFrame.setVisible(true);
    internalFrame.toFront();
}