• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Conversion of AccessibleComponent to Component

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
The objective is to obtain the parent as a Component for a JMenuItem.
For ex:
I have a menu which has menuItems added to it and also a submenu added to it.
I should be able to get the parent component associated to the sub menu.
Iam able to retrieve the name of the parent for a sub-menu but not the component.
for getting the Parent name Iam using:
subMenu.getAccessibleContext().getAccessibleParent().getAccessibleContext().getAccessibleName();
Through the above code Iam able to get the parent associated to the subMenu.
but Iam looking for is to retrieve the parent as a 'component'

We can also retrieve the
subMenu.getAccessibleContext().getAccessibleParent().getAccessibleComponent()>>>>>>Here we can retrieve the AccessibleComponent but iam not able to get the Component or the JComponent from the AccessibleComponent.

Please help me out with this....
Please let me know if Iam doing a around about and if tehre is any direct or easier way to obtain the parent Menu(component ) associated with the sub-menu,
Thankyou in advance.
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic