Your if
statement is being teminated by a ;
which will make the else
branch incorrect. Remove the ;
if(JOptionPane.showConfirmMessageDialog(f,"yes or no","it is also my message",JOptionPane.YES_NO_CANCEL_OPTION)==0);
becomes:
if(JOptionPane.showConfirmMessageDialog(f,"yes or no","it is also my message",JOptionPane.YES_NO_CANCEL_OPTION)==0)
You also have an extra curly brace }
just before your actionPerformed
begins.