/* * TableTrouble.java * * Created on September 13, 2006, 1:23 AM */ package test; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import org.netbeans.microedition.lcdui.laf.ColorSchema; /** * * @author d */ public class TableTrouble extends MIDlet implements CommandListener { /** Creates a new instance of TableTrouble */ public TableTrouble () { initialize (); } private Form form1;//GEN-BEGIN:MVDFields private org.netbeans.microedition.lcdui.TableItem tableItem1; private org.netbeans.microedition.lcdui.SimpleTableModel simpleTableModel1; private Command exitCommand1;//GEN-END:MVDFields //GEN-LINE:MVDMethods /** Called by the system to indicate that a command has been invoked on a particular displayable.//GEN-BEGIN:MVDCABegin * @param command the Command that ws invoked * @param displayable the Displayable on which the command was invoked */ public void commandAction(Command command, Displayable displayable) {//GEN-END:MVDCABegin // Insert global pre-action code here if (displayable == form1) {//GEN-BEGIN:MVDCABody if (command == exitCommand1) {//GEN-END:MVDCABody // Insert pre-action code here exitMIDlet();//GEN-LINE:MVDCAAction6 // Insert post-action code here }//GEN-BEGIN:MVDCACase6 }//GEN-END:MVDCACase6 // Insert global post-action code here }//GEN-LINE:MVDCAEnd /** This method initializes UI of the application.//GEN-BEGIN:MVDInitBegin */ private void initialize() {//GEN-END:MVDInitBegin // Insert pre-init code here getDisplay().setCurrent(get_form1());//GEN-LINE:MVDInitInit // Insert post-init code here }//GEN-LINE:MVDInitEnd /** * This method should return an instance of the display. */ public Display getDisplay () {//GEN-FIRST:MVDGetDisplay return Display.getDisplay (this); }//GEN-LAST:MVDGetDisplay /** * This method should exit the midlet. */ public void exitMIDlet () {//GEN-FIRST:MVDExitMidlet getDisplay ().setCurrent (null); destroyApp (true); notifyDestroyed (); }//GEN-LAST:MVDExitMidlet /** This method returns instance for form1 component and should be called instead of accessing form1 field directly.//GEN-BEGIN:MVDGetBegin2 * @return Instance for form1 component */ public Form get_form1() { if (form1 == null) {//GEN-END:MVDGetBegin2 // Insert pre-init code here form1 = new Form(null, new Item[] {get_tableItem1()});//GEN-BEGIN:MVDGetInit2 form1.addCommand(get_exitCommand1()); form1.setCommandListener(this);//GEN-END:MVDGetInit2 // Insert post-init code here }//GEN-BEGIN:MVDGetEnd2 return form1; }//GEN-END:MVDGetEnd2 /** This method returns instance for tableItem1 component and should be called instead of accessing tableItem1 field directly.//GEN-BEGIN:MVDGetBegin3 * @return Instance for tableItem1 component */ public org.netbeans.microedition.lcdui.TableItem get_tableItem1() { if (tableItem1 == null) {//GEN-END:MVDGetBegin3 // Insert pre-init code here tableItem1 = new org.netbeans.microedition.lcdui.TableItem(getDisplay(), "tableItem1", get_simpleTableModel1());//GEN-LINE:MVDGetInit3 // Insert post-init code here tableItem1.setColorSchema(new ColorSchema() { public Image getBackgroundImage() { return null; } public int getBackgroundImageAnchorPoint() { return 0; } public int getColor(int aColorSpecifier) { return Display.COLOR_FOREGROUND; } public boolean isBackgroundImageTiled() { return false; } public boolean isBackgroundTransparent() { return true; } }); }//GEN-BEGIN:MVDGetEnd3 return tableItem1; }//GEN-END:MVDGetEnd3 /** This method returns instance for simpleTableModel1 component and should be called instead of accessing simpleTableModel1 field directly.//GEN-BEGIN:MVDGetBegin4 * @return Instance for simpleTableModel1 component */ public org.netbeans.microedition.lcdui.SimpleTableModel get_simpleTableModel1() { if (simpleTableModel1 == null) {//GEN-END:MVDGetBegin4 // Insert pre-init code here simpleTableModel1 = new org.netbeans.microedition.lcdui.SimpleTableModel();//GEN-BEGIN:MVDGetInit4 simpleTableModel1.setValues(new String[][] { new String[] { "asdf", "asdf", "asdf", }, new String[] { "asdf", "asdf", "asdf", }, new String[] { "asdf", "asdf", "asdf", }, }); simpleTableModel1.setColumnNames(null);//GEN-END:MVDGetInit4 // Insert post-init code here }//GEN-BEGIN:MVDGetEnd4 return simpleTableModel1; }//GEN-END:MVDGetEnd4 /** This method returns instance for exitCommand1 component and should be called instead of accessing exitCommand1 field directly.//GEN-BEGIN:MVDGetBegin5 * @return Instance for exitCommand1 component */ public Command get_exitCommand1() { if (exitCommand1 == null) {//GEN-END:MVDGetBegin5 // Insert pre-init code here exitCommand1 = new Command("Exit", Command.EXIT, 1);//GEN-LINE:MVDGetInit5 // Insert post-init code here }//GEN-BEGIN:MVDGetEnd5 return exitCommand1; }//GEN-END:MVDGetEnd5 public void startApp () { } public void pauseApp () { } public void destroyApp (boolean unconditional) { } }