How do I convert my JDialog to a JFrame?

I have a problem that should be simple, but I can't quite figure out what to do. here's the situation:

  • I created a new dialog using the GUI designer in IDEA
  • I developed functionality for several weeks and now I have a bunch of working code (view, controller, model, everything)
  • I have a class for the view that is basically a mixture of the generated code and other view related code. The class is  JDialog, as was generated by the GUI designer.


Now, I changed my mind. I want this window to be a JFrame, not a JDialog, so i can minimize it and so that its icon will show up in the Windows task bar. Sounds simple, but I don't know how to do this.

  • If I change the the "extends JDialog" to "extends JFrame" then when I run my application, it immediately exits without waiting for the window to show or for the user to close it. Just poof! and it's gone.
  • I tried various dirty experiments to try and make this work, but I am completely lost here.


I am sure that this is a silly question, but I cannot find any real documentation and most of the material I found on the GUI designer is very dated.

Any ideas?

Thanks
Arnon

Please sign in to leave a comment.