-1

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!

  • 2
    Dialog is awt not the same as JDialog – nachokk Apr 11 '14 at 18:18
  • @peeskillet, I created the first Dialog from a JFrame, so I could use the this-parameter without problems. Because the fact that the first parameter has to be a Frame, I can't use "this", because "this" is a JDialog... – user3524870 Apr 11 '14 at 18:18
  • and a JDialog is a Dialog and you can use [this](http://docs.oracle.com/javase/7/docs/api/javax/swing/JDialog.html) constructor – nachokk Apr 11 '14 at 18:19
  • Oh, I think I've got it, the owner always has to be the first Frame of the application am i right? – user3524870 Apr 11 '14 at 18:21

1 Answers1

1

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

rrirower
  • 4,338
  • 4
  • 27
  • 45
  • That answer did it for me! Thank you for all of your time! The next time I will first read the Javadoc accurate ;) – user3524870 Apr 11 '14 at 18:28