• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Image select

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friends
Could anyone tell me how can i get which image has been selected by the user from a list of images.???
i know this one is a piece of cake for all the experienced guys in here!!!

Pradeep
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Nair Can u Tell me Where are the images placed - drawn over a ccanvas or a Form
 
pradeep u nair
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey shyam
the images are placed on a form.they are being generated after being downloaded. got any way i can select them.or atleast know their index?

i tried to put all of them in a list but you cant add generated images to your list unless you save them to the apt folder is it not?

Pradeep
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am assuming that you are downloading the images from a server and creating Image Objects. You then add these images to a Form as ImageItem(s). Now you would like to get which image the user has selected when the user navigates through the Form and activates the Select command ?

I hope I got that right. In this case I am not sure if you want to be dumping the downloaded images on a Form would be a good idea. The MIDP Form class does not have a getSelected method.

Alternatives
1) Dump the Images on a Canvas and implment your own logic to keep track of the current selection. You will need to handle the keypresses for UP,DOWN etc to move the nagivation on the screen. This should work but requires some work.

2) The list control is an obvious easy solution but am not sure why you are not able to use it. Does it throw a exception when you try to create a list object ?
 
pradeep u nair
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thnx for the reply friend
i tried your suggestion no.2. i placed all the images on the form in a list. but they seem to be very small.then abt the imageitem.i am trying abt it.i did not place them on a canvas.could you please help me with the methods in a canvas.
Thanx
 
Syam Sathyan George
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See da what puneet told as solution 1 is what i prefer.Its the best, go see the other thread u created abt Canvas and Events i have put there how to do this in a canvas.
Its tough to Implement but it will be easy to Control the way its selected or
moved or positioned, because its the lowest level of implementing.As u go higher to top level GUI's like form or list,the programmers needs are not met.
Most of the things in swing or awt is already missing.So Stick to Canvas(No Reksha).

And I dont know why did they make form and list so plain -no background colour,no good GUI elements no scrollable planes no panels.

[ May 06, 2006: Message edited by: Syam Sathyan ]
[ May 06, 2006: Message edited by: Syam Sathyan ]
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic