Closed GoogleCodeExporter closed 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
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
Original comment by heue...@gmail.com
on 15 May 2009 at 7:19
Original issue reported on code.google.com by
mr0...@mro.name
on 16 Dec 2008 at 10:48