GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

Helloworld from piccolo2d.org relies on piccolox #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://groups.google.com/group/piccolo2d-users/browse_thread/thread/999d1496f533
612d

Solution:

rephrase the example to use piccolo2d-core classes only and update the website.

Original issue reported on code.google.com by mr0...@mro.name on 16 Dec 2008 at 10:48

GoogleCodeExporter commented 9 years ago
I'll suggest this code as basic Hello-World example (and weave it into the 
website):

import javax.swing.JFrame;

import edu.umd.cs.piccolo.PCanvas;
import edu.umd.cs.piccolo.nodes.PText;

public class HelloPiccolo2d extends JFrame {

    private static final long serialVersionUID = 7325281186388356689L;

    public static void main(final String[] args) {
        final JFrame me = new HelloPiccolo2d();
        me.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        me.setSize(200, 50);
        me.setVisible(true);
    }

    private HelloPiccolo2d() {
        final PCanvas canvas = new PCanvas();
        final PText text = new PText("Hello World");
        canvas.getLayer().addChild(text);
        this.add(canvas);
    }
}

Original comment by mr0...@mro.name on 16 Dec 2008 at 11:06

GoogleCodeExporter commented 9 years ago
in r414 and r415 I removed PFrame in favour of JFrame from
http://piccolo2d.org/learn/out-of-box-java.html though I'm not sure if this was 
smart.

PFrame is used in /all/ the examples...

(see also: http://piccolo2d.googlecode.com/svn/site/learn/out-of-box-java.html)

Original comment by mr0...@mro.name on 16 Dec 2008 at 11:45

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 15 May 2009 at 7:19