Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jul 2005

    my requirements... (help a beginner)

    i want to develop a j2me application (midlet), in which there are
    3 forms to display.
    i want to develop it in a Object Oriented manner.
    I have created all the forms in a separate class, but the problem
    i am facing is in Command Handling.

    plz tell me,

    Should i have to implement CommandListener in each of the Form Class ?
    Should i have to implement it in a single class which is extending the MIDlet Class. ?

    Plz help me


  2. #2
    Regular Contributor
    Join Date
    Mar 2005
    It's up to you. Both ways will work.

    Each class can implement commandListeners, though from my experience, it makes it more difficult to switch between classes that way. Personally, I prefer to have no more than 2 classes with CommandListeners.

    If your commands are all similar (ie. each page has a "select" and "exit" command), then you might want to consider implementing only 1 command listener in one of the classes to reduce code size and redundancy.

    If you have references to all 3 forms from your midlet, I'd suggest having only 1 class as a commandListener, unless you have highly specific and special functions for each form that you need to implement it the other way.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts