File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes getSelectedIndex() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "getSelectedIndex()" Watch "getSelectedIndex()" New topic


Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226
I have a doubt about getSelectedIndex() of List...

Does it return the value of the index only if List.SELECT_COMMAND is pressed or return the correct index value even if we traverse over an item and try to call the getSelectedIndex()with a non List.SELECT_COMMAND Command...

And also advice me on the behaviour of ITEM type Commands with List Items...

Theepan Thevathasan
SCJP 1.4, SCWCD 1.4, SCMAD 1.0 SCBCD 1.3, MCP(.Net Frm 2.0 App Dev Fdn)
shah isha

Joined: May 01, 2007
Posts: 18
I have used list and have not set select command still its giving me right selected index anytime.

Have you come to know about select_command
Let me koow if yes

Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226

it is to capture press of Fire Button on Lists..

Thats the default...

you can change it with setDefaultSelectCommand() or something...

and when you check for press you could do this
I agree. Here's the link:
subject: getSelectedIndex()
It's not a secret anymore!