-1

I am trying to design a Form in J2ME without the use of Canvas class which has List like structure and an image as a Header.

I want to add command button (OK) So by clicking on it ... i can choose a particular item in list and get navigated to next Screen.

gnat
  • 6,213
  • 108
  • 53
  • 73
Yatin
  • 2,969
  • 9
  • 34
  • 68
  • 1
    so what is your question ?? have you got stuck anywhere ? – Lucifer Jan 27 '12 at 06:36
  • duplicated by http://stackoverflow.com/questions/9030146/desigining-a-form-in-j2me then by http://stackoverflow.com/questions/9031181/desigining-a-form-in-j2me – gnat Jan 27 '12 at 09:50
  • Yes the same duplicated... so the SOLUTION?? – Yatin Jan 27 '12 at 09:52
  • You say what you're trying to do, but not what you're tried nor where you're stuck. It's very difficult to answer your "question" without either an actual question or even any details on where you're stuck. – N_A Jan 27 '12 at 14:29
  • http://www.jappit.com/blog/2008/09/12/how-to-build-a-canvas-based-list-in-j2me/ – Yatin Mar 22 '12 at 15:32

2 Answers2

1

Just create a ImageItem from that image. Take a form and add that image to the form. And to add list, if you are using netbeans ide, you can see various UI examples by doing this: File>New project>Category:Samples>UI Demo then click finish. And run the project. By observing the samples there you will have idea.

ruben
  • 1,745
  • 5
  • 25
  • 47
0

Just look at this link. It tells how to create table(list) kind of layout using Canvas. It looks like Table with Row & Column. You can download example from here.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
  • Thanks.. but i need to try it out first .. by the way where is the code for it – Yatin Jan 27 '12 at 06:50
  • See, I have updated my answer. btw, you are "YC" from HNS ? – Lucifer Jan 27 '12 at 06:53
  • Thanks.. but i need an Implicit List and a Image header Without the use of Canvas Class ... The Link which you have posted has a Canvas Class Implemenentation – Yatin Jan 27 '12 at 07:01
  • your name Yatin, I have friend of that name so I thought you might be him. – Lucifer Jan 27 '12 at 07:24
  • no..Sorry .. but do you have a solution – Yatin Jan 27 '12 at 07:26
  • thats ok. I told you the solution I knew. I you want to do it in Form only ? – Lucifer Jan 27 '12 at 07:27
  • Yes ... an Implicit List like structure and an Image header in Form – Yatin Jan 27 '12 at 07:29
  • 1
    NO........................... – Yatin Jan 27 '12 at 07:33
  • The problem is in J2me i can't add an image and implicit looking list together together in form structure without the Canvas class.. So i tried by creating a Image and then a StringItem having 5 strings .Then i added an image as an header on Form , then the 5 strings to it . But now when i scroll through it and click on Ok Button ... how can i extract the StringText to the next Screen... – Yatin Jan 27 '12 at 07:37
  • you need to add command to each StringItem, then you can do it. – Lucifer Jan 27 '12 at 07:43
  • Should i add ... like this StringItem str="Abc" – Yatin Jan 27 '12 at 07:49
  • then str.setCommandListener() – Yatin Jan 27 '12 at 07:50
  • str.addCommand(command_name); – Lucifer Jan 27 '12 at 07:51
  • OK .. now i added The str.addCommand(Command_name) – Yatin Jan 27 '12 at 07:57
  • How can i come to know whether the particular StringItem is focused so when i click on corresponding command i can perform the action – Yatin Jan 27 '12 at 07:59
  • while performing command action you need to check , which string has been clicked – Lucifer Jan 27 '12 at 08:01
  • i have accepted it as helpful .. now if i have two different StringItem and i have added the same Command Button as str1.addCommand(ok) and str2.addCommand(Ok) ... how come i could know which String item i have selected on clicking the Ok command – Yatin Jan 27 '12 at 08:03
  • 1
    well when you have separate commands then in listener's click event method you can check which command has been press, based on that you can perform action. – Lucifer Jan 27 '12 at 08:06
  • public void commandAction(Command c, Displayable d) { // TODO Auto-generated method stub if(c==Ok) { String strText=stri[0].getText();Alert alert=new Alert(null, "Screen 1", null, AlertType.INFO); alert.setTimeout(Alert.FOREVER); display.setCurrent(alert, form); } – Yatin Jan 27 '12 at 08:08
  • Now how can i have alerts to which string i have selected if i got a Ok button to both the Strings str1 and str2 – Yatin Jan 27 '12 at 08:09