Search code examples
javajdialog

Create a JDialog from a JDialog


How can you create a JDialog when you're in a JDialog?

DialogTest dialog = new DialogTest(this,true);

The above code doesn't work because the first parameter has to be a JFrame, but in this case it's a JDialog.

Thanks in advance!


Solution

  • There are many constructors for a JDialog, one of which, will allow you to pass a Dialog. JDialog is derived from Dialog.