Posted tagged ‘swing’

GUI-Output from Apache ant

14. Oktober 2008

This is the first of my Ant snippets. I think I will post more in the future. Most of these snippets are written during discussions on the dev@ant and user@ant mailing lists for showing possibilities or solutions to problems. Sometimes I only played with something …

With <echo> you can print log messages to Ant’s output. I tried to make a „popup“, so you will be informed if a „background“ Ant process has something important to say.

    <scriptdef name="alert" language="beanshell">
        <attribute name="message"/>
        <attribute name="title"/>
            title   = attributes.get("title");
            message = attributes.get("message");

            if (title==null) {
                title =  "Ant Alert!";

            import javax.swing.*;
                null, message,
                title, JOptionPane.ERROR_MESSAGE);

    <alert message="A long and boring message"/>
    <alert message="A long and boring message" title="Danger Danger"/>