show dialog dialog construct us constructor method call actual dialog method return option pane ok option user want select choic option pane cancel option doe want param parent parent frame dialog returnvalu option pane ok option option pane cancel option dialog compon parent frame frame parent frame frame parent frame swing util ancestor frame parent titl ui dialog titl dialog dialog frame titl contain content pane dialog content pane content pane set layout border layout content pane add border layout center dialog set close oper window constant close dialog add window listen window adapt window close window event cancel dialog pack dialog set locat rel parent dialog set visibl valu 