The showMessageDialog
method is static
and therefore exists on the class not on an instance. Here is a little more explanation about static methods
The first parameter is the parent which specifise relative to which other Frame the OptionPane belongs. If it is null
, the OptionPane is independent of any other Frame. See the documentation
> parentComponent - determines the Frame in which the dialog is
> displayed; if null, or if the parentComponent has no Frame, a default
> Frame is used