Before I initialized my dialog as
addQuestionDialog = new JDialog(SwingUtilities.windowForComponent(this),"Add question);
and I set the location of the dialog to be at the center of its parent by calling:
addQuestionDialog.setLocationRelativeTo(this)
This works and displays the dialog at the center of its parent, however when I set the dialog to be a modal dialog, it completely ignores the set method and displays the dialog in the top left corner of my screen.
addQuestionDialog = new JDialog(SwingUtilities.windowForComponent(this),"Add question", Dialog.ModalityType.DOCUMENT_MODAL);