The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.swing  [141 examples] > JDesktop and JInternalFrame  [2 examples]

e842. Getting All Frames in a JDesktopPane Container

    // To create a desktop, see e841 Creating a JDesktopPane Container
    
    // Retrieve all internal frames
    JInternalFrame[] frames = desktop.getAllFrames();
    
    for (int i=0; i<frames.length; i++) {
        // Get internal frame's title
        String title = frames[i].getTitle();
    
        // Determine if the internal frame is visible
        boolean isVisible = frames[i].isVisible();
    
        // Get other properties
        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();
    }

 Related Examples
e841. Creating a JDesktopPane Container

See also: Actions    JButton    JCheckBox    JComboBox    JFrame, JWindow, JDialog    JLabel    JList    JProgressBar    JRadioButton    JScrollPane    JSlider    JSpinner    JSplitPane    JTabbedPane    JToolBar    Keystrokes and Input Maps    Layout    Look and Feel    Menus    Progress Monitor    The Screen    Tool Tips    UI Default Values   


© 2002 Addison-Wesley.