Create an application in NetBeans. I use the form designer. I would like to know what are the main differences between the forms created from JFrame and JDialog?
4 answers
If you look at the inheritance hierarchy, it becomes clear that frame, the base class for all windows, is the most common use case. They can be used in any situation. The dialogue itself is just a special case of the frame. I am sure that its purpose is auxiliary functions, - info / warning file box, input dialog, open dialog, etc ... + functions of modal windows
Compared, JFrame has a setIconImage (Image image) method that allows it to define an icon, but basically JDialog inherits from Dialog , where there is a setModal () method that allows it to be modal, there is no such thing in the JFrame , I'm sure there are many more, right now people tighten up
you should not use JDialog instead of JFrame, if it does not set alwaysOnTop, then the user may lose it, because it is not displayed in the taskbar, and if you set it up, it is clear what will happen