Como posso adicionar um ouvinte no botão OK de JoptionPane

int res = JOptionPane.showOptionDialog(null, "Hello", "Test", JOptionPane.DEFAULT_OPTION,
        JOptionPane.INFORMATION_MESSAGE, null, null, null);

System.out.println(res);
Mappy Show