How to set the JFrame as a parent to the JDialog
问题 I am having trouble to set the frame as a owner to the dialog. Normally when I extend JDialog class for creating a dialog then I use super(frame) to specify the owner of the dialog such that both of them are not disjoint when you press alt+tab . But when I create a dialog using new like JDialog dialog = new JDialog() then I am unable to specify the frame as owner to the dialog. Following example demonstrates above two approaches. Top Click button opens a dialog which is without extending