how-to

Dialogs

Confirmation dialog

For working with dialogs in Java you need use this include:

import javax.swing.JOptionPane;
Confirmation dialog contains question and more than one button.
int i = JOptionPane.showConfirmDialog( null, "Already delete file ?", "Question", JOptionPane.YES_NO_OPTION );

if ( i == JOptionPane.YES_OPTION ) JOptionPane.showMessageDialog( null, "You clicked \"YES\"." );