Showing posts with label include piccolo into java project. Show all posts
Showing posts with label include piccolo into java project. Show all posts

Thursday, December 11, 2014

An Introduction to Piccolo

I googled "download piccolo.jar", selected Piccolo Home Page, www.piccolo2d.org, clicked Download, Compiled Source (2.9MB).

See www.piccolo2d.org for more information.

    <dependency>
      <groupId>org.piccolo2d</groupId>
      <artifactId>piccolo2d-core</artifactId>
      <version>1.3.1</version>
    </dependency>


mvn install:install-file -Dfile="C:\Users\Scott\Desktop\piccolo2d-1.3.1-bin\piccolo2d-core-1.3.1.jar" -Dpackaging=jar -DgroupId=org.piccolo2d -DartifactId=piccolo2d-core -Dversion=1.3.1


package com.mycompany.gui;

import javax.swing.JFrame;

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

public class MainFrame extends JFrame {
    private MainFrame() {
        final PCanvas canvas = new PCanvas();
        final PText text = new PText("Hello World");
        canvas.getLayer().addChild(text);
        add(canvas);

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(600, 400);
        setVisible(true);
    }
    
    public static void main(String[] args) {
            new MainFrame();
    }

}


This post was reposted from http://scottizu.wordpress.com/2013/08/20/an-introduction-to-piccolo/, originally written on August 20th, 2010.