Here you can find the source of cascadeDialog(JDialog dialog, JDialog parent)
static public void cascadeDialog(JDialog dialog, JDialog parent)
//package com.java2s; // it under the terms of the GNU General Public License as published by import javax.swing.*; import java.awt.*; public class Main { static public void cascadeDialog(JDialog dialog, JDialog parent) { Point p = parent.getLocationOnScreen(); p.x += 20;/*www . j ava 2s . c om*/ p.y += 20; dialog.setLocation(p); } }