0 Replies Latest reply: Mar 27, 2011 2:21 PM by 850577 RSS

    command button to get next value?

    850577
      i am new to j2me
      i have this code which just shows 2x10=20 for now

      Code:
      import javax.microedition.midlet.*;
      import javax.microedition.lcdui.*;

      public class TestMidlet extends MIDlet {

      private Form form;
      private StringItem testTable1;
      private Command testTable1Command = null;


      public void startApp() {
           Display.getDisplay(this).setCurrent(getValue(2));
      }

      public void pauseApp() {
      }

      public void destroyApp(boolean unconditional) {
      }


      // form.addCommand(getExitCommand());
      //
      //form.setCommandListener(this);



      private int getValue(int val){


      int total=val*10

      return total;
      }


      }

      what i want is add a 'NEXT' button(Command button) in the main display or canvas
      which clicked shows value of (value+1)x10 and so on
      for eg
      on first 'NEXT' click it should show 30(ie 3x10)
      again pressed shows 40 and so on

      i actually want to implement it to a calendar code
      next i press on next on january display calendar of feburary should come
      suppose calendar is being displayed in getValue function
      I want to make concept clear through above simplified example

      thanks