Here you can find the source of centerDialog(JDialog dialog)
Parameter | Description |
---|---|
dialog | a parameter |
public static void centerDialog(JDialog dialog)
//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); } }