public void openWindow(JInternalFrame aWindow, String aTitle, boolean aIsMaximizable, boolean aIsClosable, boolean aIsResizable, boolean aSetCentre, boolean aSetModal) {              
        if (aSetModal) {
            jDesktopPane1.add(aWindow, javax.swing.JLayeredPane.MODAL_LAYER);
        } else {
            jDesktopPane1.add(aWindow, javax.swing.JLayeredPane.DEFAULT_LAYER);
        }
        
        aWindow.setTitle(aTitle);
        aWindow.setVisible(true);
        if (aIsMaximizable) {
            aWindow.setMaximizable(true);
        }
        if (aIsResizable) {
            aWindow.setResizable(true);
        }
        if (aIsClosable) {
            aWindow.setClosable(true);
        }

        if (aSetCentre) {
            Dimension desktopSize = jDesktopPane1.getSize();
            Dimension aWindowSize = aWindow.getSize();
            aWindow.setLocation((desktopSize.width - aWindowSize.width) / 2, (desktopSize.height - aWindowSize.height) / 2);
        }

        try {
            aWindow.setSelected(true);
        } catch (PropertyVetoException ex) {
            JOptionPane.showMessageDialog(this, "Could not open requested window. " + ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }