First you add JavaScript LIKE the following to the page's JSP file (you have to replace button1 with whatever the id is for your button). I add it just before the </ui:head> tag.
<script type="text/javascript"><![CDATA[
function disableButton() {
var domNode = document.getElementById('form1:button1')
domNode.setProps({disabled: true});
}]]></script>
Next, in the Visual Designer, select the button and, in the Properties window, set the onClick property to the following:
setTimeout('disableButton()', 1)