Getting Window with wich JMenu is asociated...

Hello !
im a total newbie (well i code java for 1 year but just those entry level apps); so here's my problem,
i want to get reference to JFrame object - the one wich holds JMenuItem wiich is clicked.
So again - i attach the listener i get JMenuItem object by invoking getSource();
and then i tried getTopLevelAncestor wich gives me null even trough JMenuBar is attached to a frame.
i tried getParent on JMenuItem - but it gives me JPopupMenu invoked again gives me null...
so i need some help i guess - i cant figure it out.
PS.
I consider forwarding JFrame reference to a listener to be a bad habit... or maybe its comonly used and im just overcomplicating by trying to get frame reference from JMenuItem level ?

I see no reason why SwingUtilities.getWindowAncestor wouldn't work.
Otherwise you could always set the JFrame as a client property of the menu items.

Similar Messages

  • When I bring up my Mozillafirefox, all I get is a window with a blank white screen. (I 'reinstalled' Firefox 3.66 about a month and a half ago, (and lost all my bookmarks as a result therein), and hope I can get my firefox back this time without having t

    When I bring up my Mozillafirefox, all I get is a window with a blank white screen, (and the firefox logo). (After using Firefox very happily for over a year, I had to 'reinstall' Firefox 3.66 about a month and a half ago, (and lost all my bookmarks as a result therein), and hope I can get my firefox back this time without having to reinstall. Mozilla Firefox is still listed as one of my active programs). HELP! Is there a way to get my firefox back without reinstalling? Many thanks!
    == This happened ==
    Every time Firefox opened
    == June 30, 2010 ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)

    same problem. wtf. just happened one day when i went to use it. nothing out of the ordinary installed either....

  • PS CS5 Extended on Windows -  When trying to use the clone stamp and/or healing brush as soon as I move the cursor over the image I get an exact copy of the existing layer that moves around the window with the movement of the clone stamp/healing brush.  W

    PS CS5 Extended on Windows
    When trying to use the clone stamp and/or healing brush as soon as I move the cursor from the toolbar over to the image I get an exact copy of the existing layer that moves around the window with the movement of the clone stamp/healing brush.  This just started tonight.  What's causing this weird behaviour?

    What are the settings in Window > Clone Source?

  • I am having a problem with pop pups and small windows with ads constantly opening up on my safari?? Thought that macs didn't get virus? this looks like one- any experts around? please help me fix it with your instructions? really don't know what to do...

    Hi everyone,
    I am having a problem with my Mac OS X 10.7.5 mac book air , there are constant pop pups and small windows with ads blinking constantly opening up on my safari in front of everything?? it is constantly interupting me and makes me mistakingly click on it then another new windows open behind the one im using..
    I am not too sure if thats a virus or trojan.. I always thought that macs didn't get virus? this looks like one to me… any experts around? please help me fix it with your instructions? really don't know what to do... thanks

    Those are not viruses. You have probably installed some malware:
    The Safe Mac » Adware Removal Guide
    Helpful Links Regarding Malware Protection
    An excellent link to read is Tom Reed's Mac Malware Guide.
    Also, visit The XLab FAQs and read Detecting and avoiding malware and spyware.
    See these Apple articles:
              Mac OS X Snow Leopard and malware detection
              OS X Lion- Protect your Mac from malware
              OS X Mountain Lion- Protect your Mac from malware
              About file quarantine in OS X
    If you require anti-virus protection Thomas Reed recommends using Dr.Web Light from the App Store. It's free, and since it's from the App Store, it won't destabilize the system. If you prefer one of the better known commercial products, then Thomas recommends using Sophos.(Thank you to Thomas Reed for these recommendations.) If you already use Sophos, then be aware of this if you are using Mavericks: OS X Mavericks- Sophos Anti-Virus on-access scanner versions 8.0 - 9.1 may cause unexpected restarts
    From user Joe Bailey comes this equally useful advice:
    The facts are:
    1. There is no anti-malware software that can detect 100% of the malware out there.
    2. There is no anti-malware that can detect anything targeting the Mac because there
         is no Mac malware in the wild, and therefore, no "signatures" to detect.
    3. The very best way to prevent the most attacks is for you as the user to be aware that
         the most successful malware attacks rely on very sophisticated social engineering
         techniques preying on human avarice, ****, and fear.
    4. Internet popups saying the FBI, NSA, Microsoft, your ISP has detected malware on
        your computer is intended to entice you to install their malware thinking it is a
        protection against malware.
    5. Some of the anti-malware products on the market are worse than the malware
        from which they purport to protect you.
    6. Be cautious where you go on the internet.
    7. Only download anything from sites you know are safe.
    8. Avoid links you receive in email, always be suspicious even if you get something
        you think is from a friend, but you were not expecting.
    9. If there is any question in your mind, then assume it is malware.

  • How can I get a pdf. to open in Safari, all i'm getting is a new window with a black, blank page, instead of the pdf., and I don't want to save the file to the desktop, Safari didn't use to do that, and I don't have Adobe in the internet plug in folder.

    How can I get a pdf. to open in Safari, all i'm getting is a new window with a black, blank page, instead of the pdf., and I don't want to save the file to the desktop, Safari didn't use to do that, and I don't have Adobe in the internet plug in folder.

    Hi
    Please take a look to this thread Re: Can I refresh the browser rather than open a new tab?

  • After upgrading to mountain lion i keep getting an error message saying my startup disc is full. it shouldnt be full because there is barely anything on there and i was running windows with bootcamp prior to this with no issues

    after upgrading to mountain lion i keep getting an error message saying my startup disc is full. it shouldnt be full because there is barely anything on there and i was running windows with bootcamp prior to this with no issues. my computer now freezes and programs close randomly. The usual command for opening windows with bootcamp doesnt work. once in restarted my computer after it froze and it rebooted in windows automatically. i really just want to know if there is a way to take the upgrade off my laptop because it is very annoying.

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    Thanks for chipping in.   I discovered something after trying what you suggested.   I have quite a few collections of hits by year from Time Life and Billboard.  I've eliminated duplicate tracks that appear in both collections (or other CDs for that matter), but cross-reference the CD where I deleted the track and placed in in the comments section of the CD track I retained.   If I "search" by song name, only the remaining track appears.   But if I want to hear for example Classic Rock 1964, only those tracks remaining would be there when I pull up that CD.   So, I type "Classic Rock 1964,"  in the search field.  First the boxes on the right of the screen open up showing album icons.  Showing four tracks by album with a button to view 10 more, then four songs with an option to vies 18 more.   I finally noticed that at the top of the boxes is a blue band that reads, :Show Classic Rock 1964 in Music.  When I double click on this blue band, all 24 tracks from the original CD appear in the song list format even though I had deleted two of them because they appeard in a Beach Boys CD.   On those tracks, I had referenced Classic Rock 1964 in the comments field.    So, bottom line, Search will also look in the comments field if you click "filter by all" in the magnifying glass to the left of the search field.   And you can move all tracks that if finds into a song list by double clicking on the blue band.

  • I am having a problem when I try to select a photo or itunes song in Imovie or other programs. I get a window with grey lettering that says: "Open Itunes to populate this list" or "Open iphoto to see photos from your iPhoto library in this list.  I have t

    I am having a problem when I try to select a photo or itunes song in Imovie or other programs. I get a window with grey lettering that says: "Open Itunes to populate this list" or "Open iphoto to see photos from your iPhoto library in this list.  I have tried relaunching programs and nothing appears. Seemed to start happening a while back after one of my system upgrades.

    After a a lengthy conversation with Apple Tech. ($20), my problem seems to be solves. The Iphoto problem solved by trashing the plist file. The Itunes was more involved. We had to create a new Itunes folder and import the files into the new folder; and then import the playlists.

  • While updating my iphone 4s to ios6, I had to restore it. Now every time I connect to itunes, I get the "Set Up Your iPhone" window with the set up as new iphone and restore from backup options. After the restore, I got everything except my apps back.

    While updating my iphone 4s to ios6, I had to restore it. Now every time I connect to itunes, I get the "Set Up Your iPhone" window with the set up as new iphone and restore from backup options. After the restore, I got everything except my apps and music back. Do I need to set the phone up as new again?

    Hi Vidbrent,
    If you are having issues updating or restoring your iPhone, you may find the following article helpful:
    Apple Support: If you can't update or restore your iOS device
    http://support.apple.com/kb/ht1808
    Regards,
    - Brenden

  • I have an old Mac G5 with OSX 10.5.8  After a crash of my HD, I reinstalled the CS3. At the time of recording I get a window with the message "COMPLETED REGISTRATION" and under "There was a problem sending the informasioni via internet" and still under th

    I have an old Mac G5 with OSX 10.5.8
    After a crash of my HD, I reinstalled the CS3.
    At the time of recording I get a window with the message "COMPLETED REGISTRATION" and under "There was a problem sending the informasioni via internet" and still under three choices to "send back" and "records in a second time "or" never record "and I continue to choose the latter option.
    Another problem is that in Bridge (version 2.0.0.975) I can no longer see thumbnails of RAW files from my Canon 40D that I saw before.
    Should I upgrade ACR? which is the latest version supported on my Mac?
    thank you

    Sergio Bellotto if you keep receiving the registration screen then please try accepting the screen in a different User account.

  • Trying to Get Started With Windows 8.1

    I'm not a troll, I'm just a crotchety, oldster trying to figure out how to get Windows 8.1 to fit my workflow.  I've been using Windows 7 for the last bunch of years, so I'm a bit late to the Windows 8 party, but I'm building a new PC and figured I'd
    move to 8.1 instead of continuing with 7...
    I liked the XP interface - extremely easy to find the application I wanted because things were hierarchical. Windows 7 was more bothersome, but I got used to it.  So far, after 3 days, I'm still struggling with Windows 8.1, so I figure I'll get some
    guidance here...
    I did a rummage, but didn't find much on how I should change my workflow to make it easier in 8.1.  In Windows 7 I had a desktop with icons for less frequently used applications, a taskbar with frequently used applications pinned, and a start menu (3rd
    party) with EVERYTHING organized hierarchically so it was easy to find what I need. I'm trying to use 8.1 without adding a bunch of 3rd party stuff to make it look more like older interfaces that were organized differently.
    In Windows 8, I appear to have the equivalent of THREE desktops, all different, none with any hierarchical organization.  
    I'm not seeing the advantage of the Start screen...  Are the boxes, of whatever size, just the equivalent of icons or do they do something better?  And I only appear to be able to organize horizontally, which means I'm limited to six named groups.
    On the Apps screen, I already have a large number of my apps, despite deleting a bunch of the "modern" things.  They exceed the width of the 24" monitor I'm using for setup.  There doesn't seem to be any hierarchy there, either. 
    So, for example, for Office I have at least 12 icons/apps/whatevers.  Including the ones I CARE about, like Word, Excel, Powerpoint, and Outlook that I use regularly.  AND a bunch of OTHER stuff I VERY rarely use like Clip Organizer, and Groove,
    and Uploader, and so on.  But, I can't take them off the screen if I ever want to get at them, right?  'Cause there's no start menu any more...
    I also have a lot of stuff for handling e-books - Calibre, a Kindle Reader, OverDrive, Adobe Digital Additionsl, a Nook Reader, a couple 3M cloud things, and so on.  On the Apps page they're all OVER the place instead of being grouped together (which at
    least the Office stuff is).  And there doesn't appear to be a way to have them be together and hierarchical so I can quickly find Calibre or ADE quickly, and only have to see the Kindle reader or Nook reader when I want them...  So how do folks organize
    their screens so they don't have to wade through hundreds of things you only need once a year to get to the ones you use a couple times a month or once a week?
    I also have a bunch of stuff that's just a single application, like Syncback, but instead of just being "Syncback", there' ANOTHER line that tells me who the creator is - I don't care that 2BrightSparks made it, I just want to be able to find it when
    I need it - once in a while.
    The desktop is as it's always been, but I don't want 2 or 300  icons on there for a bunch of stuff I rarely use.  The constantly used stuff will be pinned to the taskbar, and the less frequently can be icons, but where do I do to organize all the
    other stuff?
    So, in my ignorance - is there a way to have 8.1 support MY workflow, or if not, how do other people organize things to make it as easy as possible to find what you need without having to wade through a ton of stuff you don't?  And have it all fit on the
    screen. 
    I found the Name Group thing for the Start screen, but I can only group applications aross the screen?  Which limits me to 6 groups.  How do I configure that screen so I can have multiple groups in a column?
    And the Apps screen.  How do I organize things hierarchically so I can have the Office stuff I care about visible, with the rest not clogging up space but available for drilling down?
    I currently have the system boot to the desktop, which is most like Windows 7, but without a start menu to group things, I'd need a lot of icons for the applications I use, and a lot MORE for the stuff I rarely use.  Cumbersome.
    How are other people organizing in 8.1?

    I have a Dell U3014 as well as a couple of older Dells turned up sideways as "ears".
    Other than supplying the desktop "theme" (if you can call a complete lack of style along with a fair bit of inconsistency a "theme"), the OS really shouldn't be causing you to have a washed-out desktop experience.  That's more a
    matter of your display driver not really doing its job.  What video card do you have?
    FYI, one of the reasons I like Aero Glass for Win 8.1 (a 3rd party package) is that it allows me to make the desktop more pleasant to use and helps set the client areas (i.e., where work gets done) apart from the window chrome.
    From what I can see, the color-management logic in Windows 8.1 is essentially unchanged from what it was in Windows 7.  That there has been NO progress in this area is really a disappointment.  It's an area where Microsoft has again just stopped
    trying to make improvements.
    If it's at all interesting to you, here's a screen grab of a REALLY cluttered up desktop.  I don't normally work this way; this was an exercise to see how much I could get running.  I finally gave up starting more stuff as I grew tired
    and it just kept working fine...
    http://Noel.ProDigitalSoftware.com/ForumPosts/Win81/BusyDesktop.png
    -Noel
    Detailed how-to in my eBooks:  
    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options

  • I have a new imac with osx 10.6.8 and can't get letter box to open in the mail window with 3 columns.  I have downloaded the latest version and it also didn't open in 10.6.7.  Any ideas?

    Letterbox downloads and installs and is enabled, but does not produce the 3 columns in the mail window.  I had the same problem with 10.6.7 and now 10.6.8.  The download is the latest version (0.24b9) and the forums indicated that it works with both osx versions.  I have tried deleting the letterbox plug-in and then reinstalling, but still no luck with the 3 column mail page.  Any ideas would be most welcome.  Thanks

    i just fixed this on my machine running 10.6.8. the typical workaround is to add appropriate UUIDs, which get updated with each new os build, and break plugins (see here). Follow those instructions, but instead of adding the UUIDs they suggest for 10.6.7, add these (I found them on my machine running 10.6.8, and they work):
    064442B6-53C0-4A97-B71B-2F111AE4195B
    588FF7D1-4310-4175-9980-145B7E975C02
    for fixing on os x version 10.6.7, this may help (though letterbox 0.24b9 should work already).
    i emailed the author (aaron harnly, harnly.net) about this, but haven't heard back (a few days). to be sure, i am quite grateful, as i think we all are, for his excellent plugin, and this workaround is quite simple for dealing with updates.

  • Can't get windows 8.1 with dual boot for fedora (linux) . system is UEFI .

    Can't get  windows 8.1 with  dual boot for fedora (linux) . system is UEFI .

    Hi,
    Any update here?
    We may seek help at Fedora forum as Milos suggested, if convenient we could share the related thread link here for reference.
    In addition, please also check the information in the similar thread:
    Dual Boot Windows 8 and Linux?
    Best regards
    Michael Shao
    TechNet Community Support

  • I am using windows 7 and itunes 11.7 my i phone 5s is not getting synced with my laptop it keeps showing backing up  please help i need to put music in my phone?

    i am using windows 7 and itunes 11.7 my i phone 5s is not getting synced with my laptop it keeps showing backing up  please help i need to put music ?

    Hi,
    Have you managed to solve this problem? if yes, please highlight how you solved it...i'm facing same problem with my new Iphone 5S but udner Windows, thanks.

  • When I click on an Icon on my desktop to take me to a site (such as google) I get a message that it could not find the loaction. Then it goes ahead and opens a Firefox window with the site anyway as if the message never happened.

    When I click on an Icon on my desktop to take me to a site (such as Google) I get a message that it could not find the location. Then it goes ahead and opens a Firefox window with the site anyway as if the message never happened. Then when I close the window I see that the message is still there. I have to close it separately. Any suggestions? Oh, and this only happens if Firefox is NOT already active. If I have another Firefox window open when I click on the Icon, it just opens as expected. This message appears no matter which site Icon I select. It did not happen before I upgraded to ver 9.0.

    Hello BassoonPlayer,
    Since you are using one of the the school's Macbooks, it is quite possible that the time and date are not properly set on the computer that you are using.  FaceTime will not work if you do not have the proper time zone set up for the location that you are in.  This past week, there were a two other Macbook users I've helped by simply telling them to set the Date/Time properly.  By the way, you described your problem very well, which makes it easier for us to help you.  Hope this solves your problem -- if not, post back and I can suggest other remedies.
    Wuz

Maybe you are looking for

  • Sequence number in ADF FORM.

    hi All, I have a table with ID as primary key and have a sequence created for this primary key and have a trigger for generating sequence number while inserting the record in table. How can i map this Sequence in ADF so while inserting record from Fo

  • ITunes 7.6.2 Movie rentals for Europe?

    Well, is there going to be? It said that the upgrade would allow this, does that mean it is coming soon?

  • Count (*)  for select stmt take more time than  execute a that sql stmt

    HI count (*) for select stmt take more time than execute a that sql stmt executing particular select stmt take 2.47 mins but select stmt is using the /*+parallel*/ (sql optimer) in that sql  command for faster execute . but if i tried to find out tot

  • STO delivery should not happen for shelf life expired material

    Hai all, When we are doing PGI for STO-PO. shelf life expired material should not do the delivery.The system should give the error message. but in our system when we do PGI the shelf life expired material is deliverying. how do we maintain the error

  • Anybody who wants to moderate an IO working program - come on do it

    It just works -- help to improvr run it first then try to understand The project is to be submitted before april 15th - I discovered java around August last year My programing background only Pascal - 4 years ago For a novice - I'm really good....in