MessageDialog does not let you access buttons directly. If you need that functionality, you'll have to reimplement the dialog by yourself.