Example usage for javax.swing JDesktopPane getAllFrames

List of usage examples for javax.swing JDesktopPane getAllFrames

Introduction

In this page you can find the example usage for javax.swing JDesktopPane getAllFrames.

Prototype

@BeanProperty(bound = false)
public JInternalFrame[] getAllFrames() 

Source Link

Document

Returns all JInternalFrames currently displayed in the desktop.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JDesktopPane desktop = new JDesktopPane();
    JInternalFrame[] frames = desktop.getAllFrames();

    for (int i = 0; i < frames.length; i++) {
        String title = frames[i].getTitle();
        boolean isVisible = frames[i].isVisible();
        boolean isCloseable = frames[i].isClosable();
        boolean isResizeable = frames[i].isResizable();
        boolean isIconifiable = frames[i].isIconifiable();
        boolean isIcon = frames[i].isIcon();
        boolean isMaximizable = frames[i].isMaximizable();
        boolean isSelected = frames[i].isSelected();
    }/*w w w.j  a v  a  2  s.c o  m*/
}

From source file:Main.java

public static void main(final String args[]) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JDesktopPane desktop = new JDesktopPane();

    JInternalFrame internalFrames[] = { new JInternalFrame("Can Do All", true, true, true, true),
            new JInternalFrame("Not Resizable", false, true, true, true),
            new JInternalFrame("Not Closable", true, false, true, true),
            new JInternalFrame("Not Maximizable", true, true, false, true),
            new JInternalFrame("Not Iconifiable", true, true, true, false) };

    int pos = 0;//from  w  ww . j  av a 2s  .co m
    for (JInternalFrame internalFrame : internalFrames) {
        desktop.add(internalFrame);

        internalFrame.setBounds(pos * 25, pos * 25, 200, 100);
        pos++;

        JLabel label = new JLabel(internalFrame.getTitle(), JLabel.CENTER);
        internalFrame.add(label, BorderLayout.CENTER);

        internalFrame.setVisible(true);
    }
    desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);

    JInternalFrame[] frames = desktop.getAllFrames();

    frame.add(desktop, BorderLayout.CENTER);
    frame.setSize(500, 300);
    frame.setVisible(true);
}

From source file:com.cmsoftware.keyron.vista.admin.AgregarEmpleado.java

/**
 * Actualiza la lista de empleados de dicha ventana si est abierta.
 *//* ww  w. ja  va2  s .com*/
public void actualizarListaEmpleado() {
    Thread t = new Thread(() -> {
        JDesktopPane escritorio = getDesktopPane();
        JInternalFrame[] ventanas = escritorio.getAllFrames();
        for (int i = 0; i < ventanas.length; i++) {
            if ("com.cmsoftware.keyron.vista.admin.ListarEmpleado".equals(ventanas[i].getClass().getName())) {
                ListarEmpleado l = (ListarEmpleado) ventanas[i];
                l.actualizarModeloTabla(0, null);
                break;
            }
        }
    });
    t.start();
}

From source file:com.g2inc.scap.editor.gui.windows.EditorMainWindow.java

public void cascade(JDesktopPane desktopPane) {
    JInternalFrame[] frames = desktopPane.getAllFrames();
    if (frames.length == 0) {
        return;/*from   ww  w . ja  v  a2  s  .  c  o  m*/
    }

    cascade(frames, desktopPane.getBounds(), 24);
}