ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Ant and Swing
Date Wed, 06 Jun 2007 15:07:53 GMT
I think your application just terminates very early.
This works for me:

<project default="all">
    <property name="dir" value="tmp"/>

    <target name="all" depends="clean,createJava,build,run"/>

    <target name="clean">
        <delete dir="${dir}"/>

    <target name="createJava">
        <mkdir dir="${dir}"/>
        <concat destfile="${dir}/">
            import javax.swing.JFrame;
            public class Main {
                public static void main(String[] args) {
                    JFrame   f = new JFrame("Hello from Ant");
                    f.setSize(300, 200);
    <target name="build">
        <javac srcdir="${dir}" destdir="${dir}"/>
    <target name="run">
        <java classname="Main" classpath="${dir}" fork="true"/>



>-----Urspr√ľngliche Nachricht-----
>Von: Rafael Barrera Oro [] 
>Gesendet: Mittwoch, 6. Juni 2007 16:44
>Betreff: Ant and Swing
>How can i manage to execute a project where i use Swing ? i tried
>doing it normally but it does not work (without throwing an exception,
>it simply concludes the task without executing the Swing portion of my
>Thanks in advance
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message