Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get text value of a JButton

797160Apr 9 2008 — edited Apr 9 2008
I have a pull-down list that I'm trying to readthe current value of .
When I use this command:
titleCaptureObj = ((JButton)activewindow.findComponentAt(i,j)).getAccessibleContext().getAccessibleValue();
The returned result is
javax.swing.JButton$AccessibleJButton@17c50b9

What I want is the text that appears in the window - the current set value.

When I change getAccessibleValue to getAccessibleText, I get a null result, even though text is appearing in the pulldown list. I thought I'd tried every available AccessibleContext option, and the likely ones keep returning null results.
What am I missing?

thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2008
Added on Apr 9 2008
9 comments
1,232 views