<#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">


<#if package?? && package != "">
package ${package};

</#if>

import java.awt.BorderLayout;
import java.awt.Container;

/**
 * @author ${user}
 */
public class ${name} extends java.awt.Panel implements javax.microedition.xlet.Xlet {
    private Container c;

    /**
     * Default constructor without arguments should be.
     */
    public ${name}() {
    }
    
    /**
     * Put your initialization here, not in constructor.
     * If something goes wrong, XletStateChangeException
     * should be thrown.
     */
    public void initXlet(javax.microedition.xlet.XletContext context)
    throws javax.microedition.xlet.XletStateChangeException {
        try {
            initComponents();
            c = context.getContainer();
            c.setLayout(new BorderLayout());
            c.add(this, BorderLayout.CENTER);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new javax.microedition.xlet.XletStateChangeException(ex.toString());
        }
    }
    
    /**
     * Xlet will be started here.
     * If something goes wrong, XletStateChangeException
     * should be thrown.
     */
    public void startXlet() throws javax.microedition.xlet.XletStateChangeException {
        c.setVisible(true);
        c.validate();

        // TODO implement
    }
    
    /**
     * Free resources, stop unnecessary threads, remove
     * itself from the screen.
     */
    public void pauseXlet() {
        c.setVisible(false);

        // TODO implement
    }
    
    /**
     * Destroy yout xlet here.
     * If parameter is false, you can try to not destroy xlet
     * by throwing an XletStateChangeException
     */
    public void destroyXlet(boolean unconditional)
    throws javax.microedition.xlet.XletStateChangeException {
    }
    
    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 240, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 220, Short.MAX_VALUE)
        );
    }
    // </editor-fold>//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    
}
