How to get the JMenuBar associated with a JMenuItem?

How do I get the JMenuBar (or JFrame) associated with
a JMenuItem?
The JMenuItem is in a subMenu of a JMenu on the JMenuBar.

Hi,
JMenuBar is extending from the container class,
When a menuItem is added to it,You can get the instance of JMenuBar by type casting the getParent method on JMenuItem
ie..
JMenuItem mi1 = new JMenuItem();
JMenuBar jm = new JMenuBar();
jm.add(mi1);
JMenuBar jm2 = (JMenuBar) mi1.getParent();
Hope this helps
cheers
Ravi

Similar Messages

  • How to get the contents associated with a component.

    How to get the contents associated with a component.
    Like i have 2 buttons and i want to get the contents associated with these button without clicking them i.e without firing the event.
    By Contents i mean, whatever things we get after firing the event,we get some other window and some thing is added to the current page and so on.

    grab all the code inside the actionPerformed(ActionEvent e) method

  • How to know the forms associated with a specific transaction

    Hi..
    Can anyone please suggest me how to know the forms associated with a specific transaction.
    For Example In Finance module.
    I came to know from SDN the form associated with F.64 as F140_acc_stat_01.
    But i need the steps how to track the form name.
    Regards..
    Vinodh

    Hi,
    1.We cann't find the forms associated with a specific transaction.
    2.But,based on requirement we can go for the form selection.
    3.Suppose in account payable and receivable , we have different forms like customer statement, Dunning and Chek form etc.
    4.The functional people can find the form name in SPRO and give the details of the requirement.
      5.If u have the output type or formname u can go for the TNAPR and  TTXFP tables and u can search for the respect object.
    6.For FI u can directly find in the SPRO, by searching it with the form name.
    Regards,
    If helpful reward with points(Don't forget).

  • Just upgraded to FF 12 from FF 3.6 and most of my favicons are now dotted line squares. Any way to get the favicons associated with each web site to load?

    Just upgraded to FF 12 from FF 3.6 and most of my favicons are now dotted line squares. Any way to get the favicons associated with each web site to load? I've seen some suggested code to add but I'm not web code savvy. Thanx!

    The CheckPlaces extension can restore favicons. It is also great for checking bookmarks to ensure that they are still valid.
    * https://addons.mozilla.org/en-US/firefox/addon/checkplaces/

  • How to change the username associated with "Home"?

    My wife got a new mac (from her job) and I've taken over her previous machine, a Macbook Pro (2008). I've upgraded the system several times already, and now using OS Lion. My problem is that I want — but haven't figured out how (or it it's possible) — to change the name of "Home"  — from (a form of) her name to something else. I'm the only user with administrative privileges, and I thought that would (somehow) change the name associated with "Home" — but no, it has not.
    Is this something that can ( or must) be done via Terminal?

    dawglover wrote:
    At present, I have (sole) administrative control of the computer. But I haven't been able to change the name associated with "Home" to something other than the name originally set by the computer's previous owner/administrator (my wife).
    You can't, the original name is squirelled away all over the machine.
    The only way to get it to be all yours, is to backup all data files off the machine, hold command option r down on a wired keyboard at boot time connected to a fast Internet connection and use Disk Utility to erase the ENTIRE drive, then reinstall OS X with your AppleID and password into the Macintosh HD partition.
    When you reboot, you are greated to the intial install, where you can place your name all over the machine.
    When you erase the drive this way all programs are gone, and only those associated with AppleID can be downloaded from AppStore as they are copy protected.

  • How to change the name associated with iCloud email alias??

    I had MobileMe on the iPhone with alias email addresses and I liked how it didn’t attach any “name” to an alias. For example, I had MainUserName, then for aliases I would have [email protected], [email protected], etc. When I sent an email from my iPhone using one of the aliases as the "from" no name would be associated with the alias email address. If it was the MainUserName then it would associate it, e.g. Main User <[email protected]> will show up on the "From" field when I sent an email. But with iCloud on the iPhone (and iPad), it’s Main User <[email protected]>, Main User <[email protected], etc., which I don’t want.  If anything it should be Alias 1 <[email protected]> or Alias 2 <[email protected]>.  Anyway, I don't want any name associated with the aliases, so when I send an email it will simply say [email protected] or just [email protected] with no name association. 
    It works differently if I access iCloud through a web browser.  If I send an email via iCloud on the web, I can customize and have a different name with each alias, e.g., Tom <[email protected]> or Harry <[email protected]>  And the customization carries over to the Mail app on my Mac.  That would be ideal if the customization carried over to the iPhone and iPad, but I'd be happy if there was no name association with alias email addresses.  Hopefully, there's a solution to the iPhone/iPad situation with iCloud as I don't want the name linked with the main iCloud email address linked with all the different email aliases I have.

    Can I change the name associated with an ipod on my Mac?
    Select the iPod in the iTunes source list, click on its name, and type a new name.
    And can there be more than one iPod on one computer?
    Yes.
    (39352)

  • How to get the application expose with a mouse

    Hi,
    I want to get a quick overview of all open windows of the SAME application (= application expose). Normally, you can do this with your trackpad (three or four fingers down movement); I am now working with a "normal" (non-Apple) mouse and keyboard. How do I get the application expose with the mouse? I am able to quickly get the misson control wiht CTRL + right mouse click; and I am getting the App expose with shift + arrow down.
    Isn't there a way to get the application expose with the mouse as well? E.g. CTRL + Shift + right click would be very useful but that's taken by the 'slow moving' mission control.
    I know, it's a minor detail but it would be quite good for the workflow
    Any hint is most welcome. Many thanks.

    grab all the code inside the actionPerformed(ActionEvent e) method

  • Get the Dialog associated with an event

    So i have a Dialog with some textfields which hold the login information to a database. I press a button called "connect" which fires an event, which then connects to the database.
    I want to read the textfields within the Dialog to assemble the Connection String but i have no idea on how to get the info through the event.
    So far i have extended the JDialog with some methods like getUsername() which returns fieldUsername.getText();
    But how can i get the MyDialog object?
    getSource() returns only the button.
    getSource().getRootPane returns only the RootPane.
    Or is there even a better way to exchange this information?

    Normally you would define all the text fields as class variables within the dialog. Then when you click the button you access each field to make sure data has been entered. If it has you connnect to the database. If not, then you display error messages.
    So basically you create a "ConnectDialog" with has all the components and code contained in one place.

  • How to retrieve the text associated with a link annotation

    Hello
    In Acrobat, I created a link using the Select tool. I selected the text which I wanted to create a link.
    After with a C++ plug-in, I want to retrieve the text associated with a link annotation. Which is the function which makes it possible to find the text?
    Regards
    David G

    ok thanks for ur reply now my question regarding about ur first three message..
    U told using quad we finding their rectangle dimensions and then compare that with link annatation title. So then we retrieve link annataion right..
    Ya i already done like u told.. But i have one problem so plz solve dis..
    Problem--- see my code below
    for(int nWordCounter = 0; nWordCounter < nWordCount; nWordCounter++ )
    pdNWord = PDWordFinderGetNthWord(pdWordFinder, nWordCounter );
    PDWordGetNthQuad(pdNWord, nWordCounter, &quad);
    blh = ASFixedRoundToInt32(quad.bl.h);
    blv = ASFixedRoundToInt32(quad.bl.v);
    brh = ASFixedRoundToInt32(quad.br.h);
    brv = ASFixedRoundToInt32(quad.br.v);
    tlh = ASFixedRoundToInt32(quad.tl.h);
    tlv = ASFixedRoundToInt32(quad.tl.v);
    trh = ASFixedRoundToInt32(quad.tr.h);
    trv = ASFixedRoundToInt32(quad.tr.v);
    char *a = (char*)Asmalloc(20);
    sprintf(a, "%d %d %d %d %d %d %d %d", blh, blv, brh, brv, tlh, tlv, trh, trv);
    In dis code, the quad values of blh, blv, brh, brv, tlh, tlv, trh and trv are same for all words(pdNWord). so pls help me for dis proble..
    thanks in advance
    Raghu N

  • Get the SequenceFile associated with UIMsg_StartFileExecution

    I am catching the UIMessage UIMsg_StartFileExecution and wish to update my UI to indicate which SequenceFile is being executed.  I cannot figure out how to determine which SequenceFile is associated with this message.  Both the UIMessage.Thread and .Execute are null and StringData is empty.
    The documentation for this message states "TestStand sends this message when it begins using a sequence file. TestStand specifies the file in the UIMessage."  I don't see where TestStand specifies the file.  Is this a bug in TestStand, the documentation or on my end?
    I am capturing messages by registering the callback with RegisterUIMessageCallback() through C#.  I've also tried getting the message through GetUIMessage() and both produce the same result.
    Any ideas are appreciated.  Thanks.
    Solved!
    Go to Solution.

    I think it's in the ActiveXData property (do "as SequenceFile" on the object it returns). Also, you might consider using the ApplicationMgr control and handling the UIMessageEvent event as a .NET event. That is the recommended approach.
    Hope this helps,
    -Doug

  • How to get Font's associated with a pdf document.

    Hi All,
    I am currently working on a project related to Document Management in SAP. For this I have a set of pdf document's that needs to be classified as 'searchable' and 'Non-searchable'. I am planning to identify the document based on Font contents i.e a searchable document has some font associated with it, and non-searchable documents do not have any font associated with it.
    I am trying to use the class cl_fp_pdf_object and get the information about font. I see that there is no function which gives me this information directly. Is there any way to get font information of a pdf documents using classes ? or Is there any way to identify directly weather a document is searchable or not ?  Please help.
    DATA: l_fp          TYPE REF TO if_fp,
               l_pdfobj      TYPE REF TO if_fp_pdf_object.
        Create PDF Object.
          l_pdfobj = l_fp->create_pdf_object( connection = p_dest ).
        Set document.
          l_pdfobj->set_document( pdfdata = l_pdf ).
        Set task to get metadata.
          l_pdfobj->set_task_getmetadata( ).
        Execute, call ADS.
          l_pdfobj->execute( ).
    Thanks
    Aditya

    Just curious....why would you make "font" the basis of that classification?

  • How to get the search field with API UCM  for a specific UCM Profil

    We have UCM 10g
    For the checkIn we have for exemple the URL : http://xp-ucm1.oth.prs/idc/idcplg?IdcService=CHECKIN_NEW_FORM&dpTriggerValue=1&dpDisplayLabel=Codification%201&IsSoap=1
    To obtain all the field for the checkIn is very simple with this service(IdcService=CHECKIN_NEW_FORM) and RIDC, but for search we don't find the idc service ?
    <SOAP-ENV:Envelope>

    <SOAP-ENV:Body>

    <idc:service IdcService="CHECKIN_NEW_FORM">

    <idc:document dRevLabel="1" dUser="sysadmin" dDocName="" dDocTitle="">
    <idc:field name="xClbraUserList:isExcluded">1</idc:field>
    <idc:field name="xsgti_top_rule:isSetDefault">1</idc:field>
    <idc:field name="xlist1:isExcluded">1</idc:field>
    <idc:field name="xsgti_g_ll_niv1_1:isExcluded">1</idc:field>
    <idc:field name="xsgti_chrono_soc"/>
    <idc:field name="xsgti_g_entier4:isExcluded">1</idc:field>
    any ideas

    Hi,
    In fact, I don't want to send parameters to the search service but to get the fields to display an advanced search form of my own.
    Some rules and profiles filters the amount of fields availables and having a service that can do this filtering for me would be very useful.
    The check-in service do this for a trigger value (profile), but I can't find how UCM uses services to display the search form with the right fields depending on the rules and rights of the user.
    When I call a search form, UCM calls a service : http://xxx.xxx.xxx.xxx:xx/idc/idcplg?IdcService=GET_DOC_PAGE&Action=GetTemplatePage&Page=STANDARD_QUERY_PAGE&dpTriggerValue=xxx&dpDisplayLabel=xxx
    But with &IsSoap=1, the values returned are not good, some fields are missing, the field captions are not right... I guess UCM calls sub-services but which ones ?
    Thanks :)

  • How to get the funds credit with the cancellation of the update for old acc

    i just cancelled my old email and mac.com account. Now here is the question. How can I get the funds refunded back into my checking account when the upgrade made to the old account is now interrupted due to the fact that my previous mac.com is invalidated due to the new mac.com account that has been created and with the current update included?

    This forum is for discussing issues related to the Mail & Address Book applications included with Mac OS X 10.4 (Tiger). Yours appears to be a .Mac issue that has nothing to do with Mac OS X’s Mail. If that’s the case, the right forum for such questions would be one of the .Mac Forums, such as .Mac General, for example.

  • SharePoint 2013 Rest API - How to get the item count with startsWith

    Hi All,
    I am using the below url to get the item count for specfied startsWith. For example I want to know how many items are there in the list which starts with "A". When i hit the below url in the address bar i am getting HTTP not found.
    siteURL/sites/Apps/SharePointApp3/_vti_bin/listdata.svc/SampleList/items?$filter=startsWith(Title,’A’)
    Navaneeth

    what
    is SharePointApp3.
    here. 
    it is a webpart.
    this will not work on webpart\apps
    Also I am not sure if it will work with specific SampleList 
    Try 
    siteURL/sites/Apps/SharePointApp3/SampleList/_vti_bin/listdata.svc/Keywords?$filter=substringof('r',Title)
    If this helped you resolve your issue, please mark it Answered

  • How to get the publish method with server side actionscript?

    We publish this way at client side:
    ns.publish(name, howToPublish);
    How to get this howToPublish at server side?
    application.onPublish = function(){
        //how to know whether the stream's publishing method(live,record,append) here?

    I am not sure whether you can know mode of publish via SSAS, best way would be to use Authorisation Plug-in which can intercept you publish request and get the information which you need - in this case mode of publishing.

Maybe you are looking for