Search code examples
javaswingjoptionpane

Why does JOptionPane.showInputDialog not require a parent component argument, but JOptionPane.showConfirmDialog does?


JOptionPane.showInputDialog has a form that requires no parent component argument. JOptionPane.showConfirmDialog does. Why is this?


Solution

  • JOptionPane.showInputDialog has a form that requires no parent component argument. JOptionPane.showConfirmDialog does.

    From showConfirmDialog(Component parentComponent,Object message)

    parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used

    So..

    Why is this?

    It isn't.