How can I create a button on a AUI dialog?

I am using the AUI dialog in my jira plugin. How can I create a button on the top right corner of the panel header.

Examples of how to use dialog2 with a web item would be awesome as well, since dialogs are deprecated.