2 Replies - 2497 Views - Last Post: 26 April 2011 - 04:11 PM

#1 Awesomo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 21-February 11

Switching forms in J2ME

Posted 25 April 2011 - 03:51 PM

Hi
I'm fairly new to J2ME, and still a bit confused about switching between screens.
For example, lets say I have 3 screens
frmMainMenu
___frmClientList
______frmClientDetail

For this example, lets say I have a list on frmMainMenu and on frmClientList.
So lets say I want to look at the detail for a 'John Doe'.
I select "Client List" on frmMainMenu, then select "John Doe" on frmClientlist. When I exit frmClientDetail, I'd expect the screen to go back to frmClientList with "John Doe" still selected. Then when I exit frmClientList, I'd want to go back to frmMainMenu, with "Client List" still selected.
Hope this is clear! :)
Anyway, I'd appreciate if someone could point to how to do this. I know help must be out there somewhere, I'm probably searching on the wrong terms.
Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Switching forms in J2ME

#2 mi14chal  Icon User is offline

  • D.I.C Head

Reputation: 81
  • View blog
  • Posts: 202
  • Joined: 11-December 10

Re: Switching forms in J2ME

Posted 26 April 2011 - 02:16 AM

The forms you can switch using function setCurrent(Displayable nextDisplayable). Next when you will change forms from frmClientDetail to frmClientList you can use function setSelectedIndex(int elementNum, boolean selected) to select "John Doe".
Was This Post Helpful? 1
  • +
  • -

#3 Awesomo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 21-February 11

Re: Switching forms in J2ME

Posted 26 April 2011 - 04:11 PM

Thanks.
In relation to this, I notice some sample programs set their Exit and other buttons on the main form. These are then passed to the other forms. Would that be standard practice? Or should I declare the buttons on each form?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1