public void display() {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
                dialog.setVisible(true);
            }
        });
    }