Java JDialog Center centerDialog(JDialog dialog)

Here you can find the source of centerDialog(JDialog dialog)

Description

Centers the dialog on the screen.

License

LGPL

Parameter

Parameter Description
dialog a parameter

Declaration

public static void centerDialog(JDialog dialog) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import javax.swing.JDialog;

public class Main {
    /**//from   ww w .ja v a2s .c om
     * Centers the dialog on the screen.
     * 
     * @param dialog
     */
    public static void centerDialog(JDialog dialog) {
        dialog.setLocationRelativeTo(null);
    }
}

Related

  1. center(JDialog frame)
  2. centerDialog(final JDialog target)
  3. centerDialog(javax.swing.JDialog dialog)
  4. centerDialog(JDialog dDialog)
  5. centerDialog(JDialog dialog)
  6. centerDialog(JDialog dialog, Container parent)
  7. centerDialogInContainer(JDialog dialog, Container frame)
  8. centerDialogInWindow(JDialog dialog, Window win)
  9. centerOn(JDialog dialog, Component other)