class CreatePushButton
{
    public static void main(String[] args) throws IOException
    {<FILL_FUNCTION_BODY>}
}

        try (PDDocument doc = new PDDocument())
        {
            PDPage page = new PDPage();
            doc.addPage(page);
            PDAcroForm acroForm = new PDAcroForm(doc);
            doc.getDocumentCatalog().setAcroForm(acroForm);
            PDPushButton pushButton = new PDPushButton(acroForm);
            pushButton.setPartialName("push");
            acroForm.getFields().add(pushButton);
            PDAnnotationWidget widget = pushButton.getWidgets().get(0);
            page.getAnnotations().add(widget);
            widget.setRectangle(new PDRectangle(50, 500, 100, 100)); // position on the page
            widget.setPrinted(true);
            widget.setPage(page);
            PDActionJavaScript javascriptAction = new PDActionJavaScript("app.alert(\"button pressed\")");
            PDAnnotationAdditionalActions actions = new PDAnnotationAdditionalActions();
            actions.setU(javascriptAction);
            widget.setActions(actions);
            // Create a PDFormXObject
            PDFormXObject form = new PDFormXObject(doc);
            form.setResources(new PDResources());
            form.setBBox(new PDRectangle(100, 100));
            form.setFormType(1);
            PDAppearanceDictionary appearanceDictionary = new PDAppearanceDictionary(new COSDictionary());
            widget.setAppearance(appearanceDictionary);
            PDAppearanceStream appearanceStream = new PDAppearanceStream(form.getCOSObject());
            appearanceDictionary.setNormalAppearance(appearanceStream);
            // Create the content stream
            BufferedImage bim = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); // black
            PDImageXObject image = LosslessFactory.createFromImage(doc, bim);
            try (PDAppearanceContentStream cs = new PDAppearanceContentStream(appearanceStream))
            {
                cs.drawImage(image, 0, 0);
            }
            doc.save("target/PushButtonSample.pdf");
        }
    
<no_super_class>