Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes getSelectedIndex() question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getSelectedIndex() question" Watch "getSelectedIndex() question" New topic
Author

getSelectedIndex() question

Jason Long
Greenhorn

Joined: Dec 16, 2001
Posts: 17
Good evening. I had a question as to why I am getting this error:

I wanted to list a series of choices for the user, by using the ChoiceGroup() method. But, when I try to access their choice (from the array that I provided), I get this error.
Also, I'm having some trouble understanding how to set a variable to their response. For instance, I have this right now...
ChoiceGroup siteChoice = new ChoiceGroup("Choose a Site", List.EXCLUSIVE, cells, null);
siteScreen.append(siteChoice);
So can I access which selection they decided on? Thank-you very much for any help you could provide! Happy Father's Day!
[ edited to preserve formatting -ds ]
[ June 17, 2002: Message edited by: Dirk Schreckmann ]
Lars Vegas
Greenhorn

Joined: Dec 04, 2001
Posts: 27
I think you should use the getSelectedIndex()-Method with an object. or is it inside this class?
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Good evening. I had a question as to why I am getting this error
You are getting that error, because the method, getSelectedIndex, does not exist in the context that you are trying to use it.
by using the ChoiceGroup() method
Is that maybe not a method but a constructor?
Who is this they that you refer to?
ChoiceGroup is not a class in the standard API, so I don't know anything about it.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jason Long
Greenhorn

Joined: Dec 16, 2001
Posts: 17
Ahh, I figured out what I did wrong. Wow, I'm not that smart. Thank-you very much for your help. It is greatly appreciated!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getSelectedIndex() question
 
Similar Threads
ChoiceGroup getSelectedIndex() returns -1
How can I debug it ?
ItemStateListener & Interaction between two choicegroups
Application doesn't quit -- MiniMiniMusicApp sample from Head First Java
How can I debug it ?