What is the difference between a JFrame and a JDialog?

前端 未结 4 557
深忆病人
深忆病人 2021-02-03 22:16

What is the difference between a JFrame and a JDialog?

Why can\'t we use setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); for a JD

4条回答
  •  礼貌的吻别
    2021-02-03 22:36

    JFrame is a normal window with its normal buttons (optionally) and decorations. JDialog on the other side does not have a maximize and minimize buttons and usually are created with JOptionPane static methods, and are better fit to make them modal (they block other components until they are closed).

    But both inherit from Window, so they share much functionality.

提交回复
热议问题