Java JFrame staggerOpenedFrames(List frames)

Here you can find the source of staggerOpenedFrames(List frames)

Description

stagger Opened Frames

License

Open Source License

Declaration

public static void staggerOpenedFrames(List<JFrame> frames) 

Method Source Code

//package com.java2s;
/*/* w  ww . j a va2  s.  c  o  m*/
 KDXplore provides KDDart Data Exploration and Management
 Copyright (C) 2015,2016,2017  Diversity Arrays Technology, Pty Ltd.
    
 KDXplore may be redistributed and may be modified under the terms
 of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option)
 any later version.
    
 KDXplore is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
    
 You should have received a copy of the GNU General Public License
 along with KDXplore.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.Point;

import java.util.List;

import javax.swing.JFrame;

public class Main {
    private static final int XY_FRAME_OFFSET = 20;

    public static void staggerOpenedFrames(List<JFrame> frames) {
        JFrame previous = null;
        if (frames != null && frames.size() > 1) {
            for (JFrame frame : frames) {
                if (frame == null) {
                    continue;
                }
                if (previous != null) {
                    Point pt = previous.getLocation();
                    frame.setLocation(pt.x + XY_FRAME_OFFSET, pt.y
                            + XY_FRAME_OFFSET);
                }
                previous = frame;
            }
        }
    }
}

Related

  1. setPersistentExtendedStateMask(JFrame frame, int persistentExtendedStateMask)
  2. setWindowListenerDispose(JFrame frame)
  3. setWindowRightSide(final JFrame frame)
  4. setWinVisible(final JFrame win, final boolean vis)
  5. smartSetBounds(JFrame frame)
  6. storePrefsFrame(Preferences node, JFrame frame)
  7. tellUserToChoose(JFrame jFrame)
  8. terminarPrograma(JFrame f)
  9. toFront(final JFrame window)