• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getSelectedIndex()

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
shah isha
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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

Regards,
Isha
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah...

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
commad==List.SELECT_COMMAND
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic