JmenuItem not going away when I click outside of the applet

Hi guys,
I created a swing applet with JMenu and JMenuItem. If I click within the applet area, the JMenuItem will go away. But when I click out side of the applet, the JMenuItem will not disapear. How to fix this problem?
Thanks in advance.
yj

OK, here are the main parts. First your class must implement the FocusListener interface:
public MyClass extends JFrame implements FocusListener {
next you must add the FocusListener:
myJMenuItem.addFocusListener( this );
and finally you must implement the two methods focusGained and focusLost:
public void focusGained( java.awt.event.FocusEvent fe ) {
Object source = fe.getSource();
if ( source == myJMenuItem ) {
//you don't need to really do anything here.
public void focusLost( java.awt.event.FocusEvent fe ) {
Object source = fe.getSource();
if ( source == myJMenuItem ) {
myJToolBar.repaint(); //Or something to reset it
Essentially you are checking for when the focus is lost on the JMenubar, you might try using the focus listener on the menu item and if that doesn't work they using it on the toolbar, or even the main frame. Once the focus is lost the focusLost method is called you want to reset your menu bar and repaint it.

Similar Messages

  • My ipad will has a pop-up that will not go away when I click ok, and makes it completely impossible to use the ipad. The pop-up says: iCloud Backup: This ipad has not been backed up in 6 weeks. Backups happen when this ipad is plugged in, locked, and conn

    My ipad will has a pop-up that will not go away when I click ok, and makes it completely impossible to use the ipad. The pop-up says "iCloud Backup: This ipad has not been backed up in 6 weeks. Backups happen when this ipad is plugged in, locked, and connected to Wifi." I do not know what to do.

    Same situation.  Had to pull out the Mini to research this.  The Apple logo has been on the screen about five min, oh, just went black.  Home brought it back and popup is gone.  Wonder why this happened to many folks.

  • Java plugin not going away when browser closes

    Not really a huge problem, but just a question. At my work, we've developed an insurance card scanning applet and on one of the machines we have installed it on the plugin doesn't go away once all of the browsers are closed. The machine in question is a Windows 98 2nd Ed box and the plugin is ver 1.3.1_02. We have the software installed on 6 other similar machines at the site and none of them have the problem. On Windows 2000/XP/NT it works fine too.
    What sort of things could cause that? Browser settings or some other settings? Just curious.

    Thanks, that's sort of what I thought it might be. I didn't create the applet but I get to fix it. :)
    I've also found that the applet is leaving a file handle open somewhere. Could that be why it won't die properly? It's not that large of an applet and it's not multi-threading but we do use JAI and JNI along with communicating with the browser through JSObject which I've read can cause trouble. Do you know of any good tools that could help me track down loose threads/file handles in the applet? Or techniques to clean up properly?
    Thanks for the help.

  • I used Creative Cloud to update LR last night, along with updates to PS and Bridge. Problem is with LR. It does not open. When I click on icon the logo comes on for about .25 seconds, goes away. It does not load from Application window. I cannot start it

    help

    I had the same issue and resolution. Spotlight search for "Mail Badger" and deleting everything resolves the issue.
    I'm also running Safari 3.0.2 and 10.4.10...
    I've emailed the developer to let him know about it..
    15" MacBook Pro (C2D) SR   Mac OS X (10.4.10)  

  • Keyboard not going away when I'm not typing

    My keyboard stopped disappearing when I'm doing things like looking at photos or scrolling through text messages. Suggestions?

    Try resetting your phone by pressing the lock button and home button at the same time till the apple logo appears. That normally fixes most bugs

  • When entering a website my history will pull down in a list but when I hit enter to go to a site after typing it in that drop down doesn't close anymore, how do I fix that so it goes away when I navigate to a page?

    Example: facebook.com
    My history will drop down from the navigation bar and highlight the letters I am typing so I can choose a previous page if I want to. But when I press enter to tell it to go to a site the drop down does not go away I have to click somewhere to make it go away. It is suppose to just go away when you click one of the history items it shows or press enter to go to a site and it doesn't anymore.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Removed working Firefox 7, Installed Firefox 10.0, Firefox will not load. When I click on icon, firefox.exe process shows briefly in task manager, then goes away....no errors, nothing

    Removed working Firefox 7, Installed Firefox 10.0, Firefox will not load. When I click on icon, firefox.exe process shows briefly in task manager, then goes away....no errors, nothing. Never see browser panel at all. Also tried to install Firefox 9.0, but the same result was observed.

    Rather difficult to say what the problem may be at present but for general info please have a look at
    * [[safe mode]]
    *[[firefox will not start]]
    *[[firefox hangs]]
    Note sometimes you may have to wait a while for firefox to shutdown completly, and if it has hung then as explained in the above articles you may need to kill any firefox.exe process that is still running (and maybe plugincontainer.exe)
    Try starting firefox in [[safe mode]] e.g. by holding down shift key
    * do not make any changes in the first window, just click on continue<br/> ? Do you get as far as seeing the options window for safe mode ?
    If firefox is crashing see [[firefox crashes]], this is easier to work through if you can get firefox to start without crashing on startup. Currently some firefox users are finding Firefox 10 crashes on startup, and a new version Firefox 10.0.1 is being released very soon to deal with this and another cause of hangs.
    Not saying any of this applies to your case but recent issues include
    * ask tool bar causing hangs if video is used none English versions [/forums/contributors/708073]
    * possibly some crashes do not start the crash reporter and other issues [/forums/contributors/708122?page=2#post-45059]
    * some general info about current crashes [/questions/917748#answer-308124]

  • When I add a https link to quicklinks, when I click on it, the (:) after https does not go to the address bar and thus the link is not connected. This is happening for all quicklink bookmarks with https:

    Question
    When I add a https link to quicklinks, when I click on it, the (:) after https does not go to the address bar and thus the link is not connected. This is happening for all quicklink bookmarks with https: Is there a solution?

    Try some basic troubleshooting.
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • How is it I have 550 songs on my nano but only 269 show up in itunes...how do I get all 550songs and playlists back into itunes? Also when I click on 'computer' the nano iconn is up for about 5 secs then dissapears and I can't find it...what is going on?

    How it it I have 550 songs on my nano but only 269 show up in itunes without playlists?  How do I get all 550 songs and playlists back into itunes?
    Also when i click on "computer" the nano icon is up for about 5s then goes away and I can't find it...what is going on?

    spea105 wrote:
    How it it I have 550 songs on my nano but only 269 show up in itunes without playlists?  How do I get all 550 songs and playlists back into itunes?
    How do you manage your iPod? Do you Sync your entire music library, or only selected playlists?

  • In iphoto, when I click on Print, the preview image it shows me is an enlarged section of my photo. I cropped the photo and checked with no restraints. Once the photo goes to Print, I can't fix it back to the way it is in iphoto.

    In iphoto, when I click on Print, the preview image it shows me is an enlarged section of my photo. (In iphoto I hadI cropped the photo and checked "with no restraints." )
    Once the photo goes to Print, I can't fix it back to the way it is in iphoto.

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • App Store notifications not going away - what to do?

    iPhone 3Gs.  App Store on the phone shows three apps in need of updating, but those apps have been updated in iTunes, and the phone has synched several times since then.  Why are the notifications not going away, and is ther a way to sort this out (without having to update the apps on the phone - they are on different accounts, and it is a pain to have to log in again for each app).

    Apple has had an issue earlier with the iTunes Store and various aspects of it's operation. It's mentioned here:
    http://www.apple.com/support/systemstatus/
    It may take awhile for it to totally clear though.
    In the meantime, try the following: Shut down the App Store/ iTunes Store apps from the Multitasking bar:
    1.From the Home screen, double-tap the Home button, find the iTunes Store/App Store apps (drag the icons left/right) and swipe up on their respective screen captures, NOT on the icons at the bottom. This will close them.
    2. Wait about one minute for the apps to close off
    3. Reset the device:
    Device Reset (won't affect settings/data/music/apps/etc)
    1. Press and hold (& continue to hold) BOTH the Sleep/Wake button & the Home button.
    2. Continue to hold BOTH (ignoring any other messages that may show) until you see the Apple logo on the screen.
    3. Release BOTH buttons when you see the Apple logo and allow the device to boot normally.
    After the reset, try to open the Apps Store and see if the updates notification has cleared.

  • Mouse not going away

    I'm having issues with the mouse icon not going away on a quicktime movie I'm running for an artwork at a museum. I have a computer set to start up at a specific time and then a applescript to run on start up that opens the movie, loops it, and sets it at fullscreen. Everything works fine expect that the mouse icon won't hide and sits on the top of the movie. This only seems to be an issue when it starts up in the morning automatically, not when I manually restart the computer. Any ideas?
    Many thanks!

    Hi mcrocka:
    Welcome!
    Press the Option / Apple / esc keys at the same time. That will bring up the Force Quit option.
    Then make imovie 'quit'
    Sue

  • HD noise when flat, goes away when tilted back now wont boot

    hey guys... i've been reading some of the discussions about HD noises and sounds. it seems like everyones HDs make noise or slow down when tilted. I HAVE THE COMPLETE OPPOSITE PROBLEM. i apologize for the long post:
    12" Powerbook [purchased 05/04 and well taken care of]
    mac OSX 10.3.9
    original toshiba HD 60GB
    its kind of weird. i was running ichat, iphoto, safari, photoshop, and iflash [flashcards] all at the same time when i noticed a significant slow down in performance which stalled all programs. i then head a loud whiring humming buzz that sometimes turned into grinding. of course this freaked me out. i tilted my powerbook backward to give it a listen and then the noise went away. not only that all the programs completed all previous requests faster than ive ever seen them perform before. well i repeated this to see if the effect was reproducable, and it was.
    well the next morning i turned it on and my powerbook was working fine. no noises or indications impending failure. well i had to leave the library so i shut my powerbook off but the filevault program wanted to recover unused HD space so i let it do its thing. when i tried to power on my powerbook it got to the grey screen with thespinning gear and wont get past that point.
    figuring that it was an HD problem, i got my buddy's ibook, set my powerbook into firewire mode by booting and pressing "T", and connected them. i was able to recover data off of my non admin accounts using Migration Assistant but my main admin account wont let me even touch its files due to the filevault settings. i found away to at least get to my files in the main acct by mounting its .ars [i think thats wht it was] image i found under my non main admin account user folder. the thing that gets me is that i can easily access my HD in firewire mode, but the powerbook itself wont get past that grey apple screen. it makes unusual noises and then stops and stays stuck on that screen with the spining gear going.
    now this is a major headache since im a med student and i need my powerbook to access my flashcards, notes, and online resources. ive come to realize how dependant ive been on this machine. can anyone help me? is it my HD thats the problem? is it a filevault thing? do i just need to reformat? why do i get that sound when the PB is flat but it goes away when its tilted? now im kicking myself in the butt for not getting applecare.
    thanks guys,
    Edward
    MS2 Ross University School of Medicine
    evilmcnasty.blogspot.com

    Edward:
    Last week, my PB started making the same noise that you've described, which is opposite of the other posts, ie buzzing when flat, quiet when tilted. I ran disk utility, TechTool Deluxe (that came with AppleCare), etc without finding anything wrong. Yesterday, I noticed that my s.m.a.r.t status shows my hard drive to be failing (in red letters). My understanding is that it will fail eventually, even though I am using the computer without incident right now. Suffice it to say, I have backed everything up and am waiting for the inevitable moment. I plan to call AppleCare today (sorry to hear you don't have it) to enquire about what I should do. In particular, I cannot go without a computer right now, this malfunction being at the least opportune moment. Can anyone say if AppleCare will give me a loaner until my PB is healthy again?
    I realize that this post is of little use to your situation, but I just wanted others to know that the "opposite buzzing sound" exists and that it seems to indicate an eventual failure if mine is the typical result of the first buzzing symptoms.
    Good luck with yours.
    Ernie

  • When i open ibook, the iTunes store asks for my password. it goes away when i press cancel or when i put in my password. why is this happening?

    When I open IBook, the ITunes store asks for my password.  It goes away when I press cancel or enter my password.  It seems unnecessary to me.  Why is it doing this?  I already paid for the book. 

    If you are trying to update information for your apple id then go to appleid.apple.com and click on manage your apple ID... you'll probably have to enter your old email address/password

  • I downloaded an app in the itunes app store on my pc and it's in my library, but it will not show up when i click ipod then apps?

    I downloaded an app in the itunes app store on my pc and it's in my library, but it will not show up when i click ipod then apps?

    You need to sync the app to the iPod
    iTunes: Syncing media content to iOS devices and iPod       
    Is the app compatible with your model iPod and iOS?
    Are any Restrictions set that would prevent installing the app on your iPod? Settings>General>Restrictions
    Do any apps no sync to the iPod?
    Does any media now sync to the iPod?
    Have you successfully synced aps to this iPod from this iTunes library before?

Maybe you are looking for

  • No Form Fields Detected - Adobe Pro X

    Hi all, Having a very frustrating time today and probably missing something simple.  I have created a new PDF Form and also edited a previous Form that I have used.  However, when uploading them into our software (proprietary), we get the error "No F

  • Creating a Fillable/Savable PDF: simple question?

    Hello- I'm new to Acrobat and LiveCycle Designer.  I have just created my first form with fillable fields in LifeCycle to send to my company's clients for them to fill out, save the form with their responses in the fields for their own records, and t

  • How can I get a UTC timestamp?

    The "Get Date Time in Seconds" VI does not have a UTC option. I have an application that needs the UTC as a timestamp. I could use the "Seconds to Date/Time" with the UTC input as True.  The output of this gives me the UTC in a cluster.  This is show

  • I have been using RoboForm. Now I can not use it even after PURCHASING THE latest vr!

    I have been trying for the last TWO days to get Roboform to work with the new Firefox! I have even ''purchased'' the latest version of Roboform but I still can not get its tool bar to appear on Firefox. After trying to follow your support's instructi

  • Dump CREATE_DATA_UNKNOWN_TYPE in Program E2E_HK_CONTROLLER

    Hi solman-experts, we've  exactly the same error as in this thread Re: RCA CCMS BI SETUP program created every day 31 short dumps which you can find in the following log: (extract from the log from program E2E_HK_CONTROLLER) Phase I: Aggregating Data