[mobility] LWUIT - Form

  • From: "Osama Mohammed Shaikh" < >
  • To:
  • Subject: [mobility] LWUIT - Form
  • Date: Mon, 13 Feb 2012 17:58:05 +0000

Hello,

I am getting exception-java.lang.Error: Static initializer: 
java.lang.NullPointerException,   0
 at java.lang.Class.throwError(), bci=57
 at java.lang.Class.initialize(), bci=221
 at com.sun.lwuit.Component.<init>(), bci=5
 at com.sun.lwuit.Container.<init>(Container.java:66)
 at com.sun.lwuit.Form.<init>(Form.java:158)
 at com.sun.lwuit.Form.<init>(Form.java:676)
 at comm.DisplayDict.<init>(DisplayDict.java:20)
 at comm.commdict.StartDict.<init>(StartDict.java:15)
 at java.lang.Class.newInstance(), bci=0
 at com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=46
 at com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=66
 at com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17
 at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=27
 at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
 at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
 at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
 at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26

in the following code.

package comm;

import comm.commdict.StartDict;
import com.sun.lwuit.*;
import com.sun.lwuit.events.*;

//This class is for user interface.

public class DisplayDict implements ActionListener
{
    private Form frm;
    private Command show, clear, history, help, about, exit;
    private TextField tf;
    private Display dp;
    private StartDict sd;
    
    public DisplayDict(StartDict sd)
    {
        this.sd=sd;
        frm=new Form("COMM Dictionary");
        tf=new TextField(30);
        show=new Command("Show");
        clear=new Command("Clear");
        history=new Command("History");
        help=new Command("Help");
        about=new Command("About Dict");
        exit=new Command("Exit");
        frm.addComponent(tf);
        frm.addCommand(show);
        frm.addCommand(clear);
        frm.addCommand(history);
        frm.addCommand(help);
        frm.addCommand(about);
        frm.addCommand(exit);
        frm.addCommandListener(this);
    }
    
    public void display()
    {
        frm.show();
    }

    public void actionPerformed(ActionEvent ae)
    {
        if(ae.getSource()==exit)
        {
            sd.destroyApp(false);
            sd.notifyDestroyed();
        }
    }
}






[mobility] LWUIT - Form

Osama Mohammed Shaikh 02/13/2012

Project Features

About this Project

Mobility was started in November 2009, is owned by dstrupl, and has 37 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close