Reputation: 7417
I understand how to create an instance of a JDialog, but are they properly displayed the same way as a JFrame. Is all I have to do to make it function properly just set it to visible? Should anything else be done? Is this this correct and easiest way?
Upvotes: 1
Views: 121
Reputation: 44808
Before you display your JDialog
, you should probably pack
it. Also, if you did not supply an owner for the JDialog
when you created it, you should use setLocationRelativeTo(owner)
to make it pop up in the center of the owner.
Upvotes: 4