Add/Remove/Replace KeyboardFocusManager

Hi,
There are many buttons in a Applet and on clicking on each button an instance of another applet is opened. This Applet uses AWT and I am handling events for all the keys and I am using KeyboardFocusManager. When multiple instances of the applet is opened and when TAB key is pressed, the action goes to the first instance of the applet opened. So I am adding KeyboardFocusManager on FocusGained and removing it on FocusLost. But I am getting a SecurityException, when I am adding and removing KeyboardFocusManager:
java.lang.SecurityException: this KeyboardFocusManager is not installed in the current thread's context
     at java.awt.KeyboardFocusManager.getGlobalFocusedWindow     at java.awt.DefaultKeyboardFocusManager.dispatchEvent
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.SequencedEvent.dispatch(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy
     at java.awt.EventDispatchThread.pumpEventsForHierarchy
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)
Following is my code on FocusGained and FocusLost:
public void FocusGained(FocusEvent e) {
DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager ().addKeyEventDispatcher(new KeyEventDispatcher() {
int step = 1;
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_TAB) {
step = (++step) % 2;
if (step == 0) {
write(e.getKeyChar());
e.consume();
return true;
return false;
public void FocusLost(FocusEvent e){
KeyboardFocusManager.getCurrentKeyboardFocusManager().setCurrentKeyboardFocusManager(null);
Any thoughts how to replace the KeyboardFocusManager ?
Thanks

Could you just set the focus instead of messing with the focus manager?

Similar Messages

  • I have Firefox 4.0 Beta 6 on my system and Beta 9 was installed, now both are oon desktop neither show on Start menu and Add/Remove list only shows Beta 6 but will not remove it.

    Had a problem yesterday and Google chrome replaced Firefox as my default browser without my knowledge. I removed Chrome from my system and can use Firefox. I have two icons for Firefox on my quick launch toolbar one says Beta6 the other Beta9 but both launch Beta 9 but my Add/Remove programs shows only Beta6 and will not remove it. It seems Beta9 is the only version on my system but was not updated in my Start menu.

    If you updated from the beta 6 version to the beta 9 version then the beta 9 version has replaced the previous beta version. It can happen that the uninstall registry key of older versions isn't updated or removed and that seems to have happened in your case. So you have only the beta 9 version installed and an orphaned entry to uninstall the beta 6 version.
    If you are comfortable in editing the registry then you can remove that entry.Otherwise it is better to leave it.<br />
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox

  • How to install software that does not show in add\remove?

    I have a agent that i need to install on all our computers but the program does not show in add\remove when installed correctly.
    It does however have a service that runs and some processes that run.
    Can someone tell me what the best way of installing this is?
    Should I create a collection based of the Service\Process or even based of the file sitting in C:\Program Files.
    I wanted to create a collection of computers that had the software already then create another collection that had all computers with it missing and create a advertisement from this..
    I am just not sure how to do this one when it does not show in add\remove

    Please create the new SCCM query based collection for computers which have required software installed. We can create this collection based on service. 
    For example :Below SCCM query will add the computers which firewall service is in disabled mode.
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SERVICE on SMS_G_System_SERVICE.ResourceId =
    SMS_R_System.ResourceId where SMS_G_System_SERVICE.Name like "MpsSvc" and SMS_G_System_SERVICE.StartMode like "Disabled" 
    Create another collection for computers which have software not installed and add the below query for the collection. Replace the "CollectionID" with collectionID of first collection.
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where ResourceID not in (select ResourceID from SMS_FullCollectionMembership
    where CollectionID = "CollectionID") 

  • I cannot uninstall Firefox, either through Control Panel Add/Remove or by running helper.exe from Program Files.

    Nothing happens when I click on REMOVE for Mozilla Firefox from the Add/Remove screen of Control Panel. I then tried to run helper.exe from the Mozilla Firefox folder in Program Files, but that wouldn't run either. Any suggestions?
    == This happened ==
    Just once or twice
    == When I tried to uninstall Firefox

    unistalled foxtab, however the window saying "want to add this pers. button to toolbar" no matter what I do I can't get it off , close firefox, remove or delete or get a new firefox download to replace it in the harddrive etc. Its locked up firefox and I have to use safari to access the web. how do I get this circular message etc. off ?

  • Help! - Distorted Add Remove List control!

    Can anyone tell me why on some pc's my Add Remove list control appears stretched out - that is, the right-side 'selected' list box will extend to the left covering the add/remove buttons and the same 'selected' box is only half drawn from the left side (right side missing), including the title being truncated, and the title is then duplicated to the right in its entirety. (It is hard to describe but I can provide a screenshot if needed).
    As soon as an item is selected or de-selected, it re-adjusts itself to normalcy!
    It seems to be a browser independent problem which ONLY happens on SOME pc's and NEVER on others! This leads me to suspect an out-of-date jar or class file on the local pc but I can't seem to find anything inconsistent.
    CAN ANYONE HELP?! It is preventing us from putting this page into production and I would hate to have to write my own replacement, as it would take more time than we have.
    Thanks in advance for your assistance,
    <-j->

    PS - I have tried REPEATEDLY to add some Duke Dollars to this submission to no avail!

  • I can't add/remove apps through iTunes.

    I wanted to sync my apps with iTunes, as I haven't got the iTunes app on my iPhone (don't know how I did that either lol) and I also wanted it for some other stuff. Now the box 'Sync Apps' is unchecked, and when I check it iTunes warns me that every app and content of that app will be removed and replaced by the apps in the iTunes library.. I'm really not that keen on losing data in Whatsapp for instance, as my memory depends on that app, lol.
    Anyway, is there any possibility that I can add/remove apps through iTunes without losing data on my iphone? Maybe by making some sort of backup?
    I really hope there's someone with an answer to this one, as I'm really out of ideas to solve this.
    Thanks,
    Axel

    Guess what I didn't lose any data, not even in for instance games like Coin Dozer or Whatsapp or anything! I don't know how, but it's true! I didn't even have to re-login Wordfeud! Hurray!

  • Uninstall Acrobat 6 without Add/Remove Programs

    Hello,
    I currently have several users still running Acrobat 6 Standard.  I have purchased licenses for Acrobat X to replace these outdated packages, but am trying to automate the uninstall/install.  The program I am using to automate the process requires me to select an application for the removal; I cannot just go through Add/Remove programs.  Most programs have an Uninst.exe (or something to that effect) in the Program Files folder, but I am not seeing that on my systems.  When I go through Control Panel>Add/Remove and click "Change" it brings up what looks like the setup program with the option to remove.  This would work perfectly, but I am unable to find the executable that launches this program.  Can anyone help me locate it?
    Thanks in advance.
    If it matters, I am running XP SP3 on all machines.

    The response has been overwhelming. Thanks

  • I need my client to be able to add/remove images. Is this possible?

    I need my client to be able to easily add/remove images. Preferably without requiring my client to pay for software. Is this possible with Muse or any other Adobe product. I understand that Muse can allow in-browser swapping of images, but I'm not sure about add/remove.

    You can only edit/replace the existing content with In-Browser editing at this time. Please refer to the following article on what exactly can be edited with the help of BC IBE at this time - http://helpx.adobe.com/muse/tutorials/in-browser-editing-muse-part-1.html.
    Thanks,
    Vinayak

  • Surely SOMEONE HAS SEEN THIS BEHAVIOR???  Distorted Add Remove control!

    Lots of people have VIEWED this posting since I first posted it on Nov 30th,
    but I can't believe that NOBODY ELSE HAS SEEN THIS BEHAVIOR!
    So here it is again....
    Can anyone tell me why on some pc's my Add Remove list control appears stretched out - that is, the right-side 'selected' list box will extend to the left covering the add/remove buttons and the same 'selected' box is only half drawn from the left side (right side missing), including the title being truncated, and the title is then duplicated to the right in its entirety. (It is hard to describe but I can provide a screenshot if needed).
    As soon as an item is selected or de-selected, it re-adjusts itself to normalcy!
    It seems to be a browser independent problem which ONLY happens on SOME pc's and NEVER on others! This leads me to suspect an out-of-date jar or class file on the local pc but I can't seem to find anything inconsistent.
    CAN ANYONE HELP?! It is preventing us from putting this page into production and I would hate to have to write my own replacement, as it would take more time than we have.
    Thanks in advance for your assistance,
    <-j->
    PS - I have tried REPEATEDLY to add some Duke Dollars to this submission to no avail! The link just goes to a Pge Not Found or something similar

    As I mentioned in my original post, it seems to be a non-browser related problem - that is it shows up MOSTLY in IE, but has been seen also in Firefox.
    Any suggestions on what further to check would be GREATLY APPRECIATED!

  • I have gone to Control Panel to ADD/REMOVE PROGRAMS and clicked REMOVE Mozilla Firefox 3.6.13 but the program will not remove.

    The Mozilla Firefox 3.6.13 version is refusing to be removed from my laptop even after l have opened the CONTROL PANEL and clicked on ADD/REMOVE PROGRAMS and then clicked on REMOVE the hightlighted firefox program.
    I have just installed the Mozilla Firefox 4.0 and when l try to uninstall or remove this one the same way as l do for Firefox 3.6.13, l have no problem with removing Firefox 4.0.

    The following link shows how to manually remove Firefox if the uninstaller fails - http://kb.mozillazine.org/Uninstalling_Firefox
    Are you sure you still have Firefox 3.6, by default Firefox 4 will replace previous versions of Firefox. Some time the add/remove programs option in the control panel will list programs that no longer exist.

  • Tried to install newest itunes, crashed during install, and now crashes my computer every time i try to uninstall.  Itunes doesn't show up in the Add/remove prog list at all.  tried to roll back over a month, still crashing.

    So I tried to update to the newest Itunes.  It locked up my computer part way thru the install.  Black screen, computer turned itself off.  Now anytime i try to do anything with Itunes it shuts my computer down.  I can start up fine in safe mode but when i try to uninstall from there, Itunes doesn't exist.  the other apple programs do, but no itunes.  when i try to uninstall the other programs in safe mode it tells me it can't because the windows installer isn't loaded.  I have system restored to over a month ago and itunes still doesn't show up in add/remove programs.  however, i can open itunes.  it just tells me a file didn't get installed and to uninstall and reinstall.  So, how do i remove a progam that doesn't think it exists and crashes my computer when i try to do anything related to it???  I'm out of ideas.  running windows vista.

    I think my problem is fixed now.
    For the fun of it, I reinstalled iTunes 9.2.1 today (using the exact same installer as I did yesterday), but this time I didn't uninstall iTunes first. As expected, iTunes recognized my iPhone (as I expected it to, until my next reboot).
    A few minutes later, Software Update showed up and among the updates is "iPhone SDK Compatibility Update". The description indicates that installing this should fix an issue where iPhones and iPod touches aren't recognized by iTunes. Isn't that interesting?
    I installed that update and most of the others waiting for me (including Java, Safari 5.0.1, and a few others - not 10.6.4 though, due to the issues with nVidia graphics cards). After the reboot, I started iTunes, and it saw my iPhone!
    So, if you're having this same problem, I'd recommend tracking down this update and see if that does the trick for you. Hopefully it will.

  • I have installed Adobe Premiere Pro cc on my laptop, but I cant find a way to start the program. No Icon, and it is not showing up in the start meny. It is showing up in add/remove programs, but nt anywhere else.

    I have installed Adobe Premiere Pro cc on my laptop, but I cant find a way to start the program. No Icon, and it is not showing up in the start meny. It is showing up in add/remove programs, but nt anywhere else.

    If you are using a Mac, simply hit Command-Spacebar to bring up Spotlight Search.  Begin typing the name of the application and when you see what you are looking for, press enter.  You should get a hit by the second or third letter you type.  Great way to launch apps on computers that you are not familiar with.
    Windows 7 and 8 should have something similar.  I think you simply press the Windows key and begin typing.  Press enter when you see a match.
    Both Mac and Windows search tools can be customized to search for applications, files, emails and so forth.  For Windows, look for Taskbar and Start Menu Properties.  For Mac, go to Preferences Spotlight.  Turn off items you know you won't need to speed up searches.
    Make Windows 7 Start Menu Search Find Your Applications Faster

  • Add/Remove Programs - export to text file?

    Hello,
    I am wondering if it is possible to export a list of everything in add/remove programs to a text file for inventory purposes.
    I have not found any easy method to do this short of copying reg files or installer 3rd party software.  Since the idea is to save time neither of those are viable solutions.
    Does anyone have any ideas?
    -Justin

    You could try this vbs script that lists installed programs and add info to a text file.
    Michael Petersen
    Option Explicit  
    Dim sTitle  
    sTitle = "InstalledPrograms.vbs by Bill James" 
    Dim StrComputer  
    strComputer = InputBox("Enter I.P. or name of computer to check for " & _  
                           "installed software (leave blank to check " & _  
                           "local system)." & vbcrlf & vbcrlf & "Remote " & _  
                           "checking only from NT type OS to NT type OS " & _  
                           "with same Admin level UID & PW", sTitle)  
    If IsEmpty(strComputer) Then WScript.Quit  
    strComputer = Trim(strComputer)  
    If strComputer = "" Then strComputer = "." 
    'Wscript.Echo GetAddRemove(strComputer)  
    Dim sCompName : sCompName = GetProbedID(StrComputer)  
    Dim sFileName  
    sFileName = sCompName & "_" & GetDTFileName() & "_Software.txt" 
    Dim s : s = GetAddRemove(strComputer)  
    If WriteFile(s, sFileName) Then 
      'optional prompt for display  
      If MsgBox("Finished processing.  Results saved to " & sFileName & _  
                vbcrlf & vbcrlf & "Do you want to view the results now?", _  
                4 + 32, sTitle) = 6 Then 
        WScript.CreateObject("WScript.Shell").Run sFileName, 9  
      End If 
    End If 
    Function GetAddRemove(sComp)  
      'Function credit to Torgeir Bakken  
      Dim cnt, oReg, sBaseKey, iRC, aSubKeys  
      Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE  
      Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _  
                  sComp & "/root/default:StdRegProv")  
      sBaseKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" 
      iRC = oReg.EnumKey(HKLM, sBaseKey, aSubKeys)  
      Dim sKey, sValue, sTmp, sVersion, sDateValue, sYr, sMth, sDay  
      For Each sKey In aSubKeys  
        iRC = oReg.GetStringValue(HKLM, sBaseKey & sKey, "DisplayName", sValue)  
        If iRC <> 0 Then 
          oReg.GetStringValue HKLM, sBaseKey & sKey, "QuietDisplayName", sValue  
        End If 
        If sValue <> "" Then 
          iRC = oReg.GetStringValue(HKLM, sBaseKey & sKey, _  
                                    "DisplayVersion", sVersion)  
          If sVersion <> "" Then 
            sValue = sValue & vbTab & "Ver: " & sVersion  
          Else 
            sValue = sValue & vbTab   
          End If 
          iRC = oReg.GetStringValue(HKLM, sBaseKey & sKey, _  
                                    "InstallDate", sDateValue)  
          If sDateValue <> "" Then 
            sYr =  Left(sDateValue, 4)  
            sMth = Mid(sDateValue, 5, 2)  
            sDay = Right(sDateValue, 2)  
            'some Registry entries have improper date format  
            On Error Resume Next   
            sDateValue = DateSerial(sYr, sMth, sDay)  
            On Error GoTo 0  
            If sdateValue <> "" Then 
              sValue = sValue & vbTab & "Installed: " & sDateValue  
            End If 
          End If 
          sTmp = sTmp & sValue & vbcrlf  
        cnt = cnt + 1  
        End If 
      Next 
      sTmp = BubbleSort(sTmp)  
      GetAddRemove = "INSTALLED SOFTWARE (" & cnt & ") - " & sCompName & _  
                     " - " & Now() & vbcrlf & vbcrlf & sTmp   
    End Function 
    Function BubbleSort(sTmp)  
      'cheapo bubble sort  
      Dim aTmp, i, j, temp  
      aTmp = Split(sTmp, vbcrlf)    
      For i = UBound(aTmp) - 1 To 0 Step -1  
        For j = 0 to i - 1  
          If LCase(aTmp(j)) > LCase(aTmp(j+1)) Then 
            temp = aTmp(j + 1)  
            aTmp(j + 1) = aTmp(j)  
            aTmp(j) = temp  
          End if  
        Next 
      Next 
      BubbleSort = Join(aTmp, vbcrlf)  
    End Function 
    Function GetProbedID(sComp)  
      Dim objWMIService, colItems, objItem  
      Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2")  
      Set colItems = objWMIService.ExecQuery("Select SystemName from " & _  
                                             "Win32_NetworkAdapter",,48)  
      For Each objItem in colItems  
        GetProbedID = objItem.SystemName  
      Next 
    End Function 
    Function GetDTFileName()  
      dim sNow, sMth, sDay, sYr, sHr, sMin, sSec  
      sNow = Now  
      sMth = Right("0" & Month(sNow), 2)  
      sDay = Right("0" & Day(sNow), 2)  
      sYr = Right("00" & Year(sNow), 4)  
      sHr = Right("0" & Hour(sNow), 2)  
      sMin = Right("0" & Minute(sNow), 2)  
      sSec = Right("0" & Second(sNow), 2)  
      GetDTFileName = sMth & sDay & sYr & "_" & sHr & sMin & sSec  
    End Function 
    Function WriteFile(sData, sFileName)  
      Dim fso, OutFile, bWrite  
      bWrite = True 
      Set fso = CreateObject("Scripting.FileSystemObject")  
      On Error Resume Next 
      Set OutFile = fso.OpenTextFile(sFileName, 2, True)  
      'Possibly need a prompt to close the file and one recursion attempt.  
      If Err = 70 Then 
        Wscript.Echo "Could not write to file " & sFileName & ", results " & _  
                     "not saved." & vbcrlf & vbcrlf & "This is probably " & _  
                     "because the file is already open." 
        bWrite = False 
      ElseIf Err Then 
        WScript.Echo err & vbcrlf & err.description  
        bWrite = False 
      End If 
      On Error GoTo 0  
      If bWrite Then 
        OutFile.WriteLine(sData)  
        OutFile.Close  
      End If 
      Set fso = Nothing 
      Set OutFile = Nothing 
      WriteFile = bWrite  
    End Function 
    Deploy deploy deploy

  • Unable to add/remove users in Mountain Lion Server (Options are greyed out)

    For some reason, im unable to add/remove users in Mountain Lion server. The + and - are greyed out. It seems like something is wrong with the permissons because it looks like it cant write the the Ldav3 file (although that may be speculation). Does anyone have any advice for me? I URGENTLY need to add users.
    Maybe theres a way to restore default permssions for the boot drive (if that in fact is the issue). Hopefully there is a way that I can fix this while leaving all users, groups, their permissions and shares intact.

    Anything interesting and relevent in the server logs?
    Anything interesting in the server alerts?
    Since it's far and away the most common cause of problems with OS X Server and with distributed authentication (Open Directory is entirely based on network encryption and digital certificates and on responses from your local DNS server(s)), verify your local DNS configuration is working and requires no changes with the following Terminal.app (Applications > Utilities) harmless, diagnostic command:
    sudo changeip -checkhostname
    sudo requires an administrative password.  You might get a one-time warning about the sudo, and that can safely be ignored.  The command will display some details, and indicate whether the local configuration appears valid and no changes are required, or further diagnostics for (most) common errors that can arise.

  • Which adobe to use, I was told to down load the newer version and the add/remove folder says I have 10.1.82.76, is tehis the one I need?

    The latest update from Firefox said I HAD to update Adobe or there would be a security problem. I replied to the answer about the edit bar, but have not received a reply:
    This is what I wrote:
    Thank you for helping me. I had no idea how to do that. Now if you can tell me about the adobe issue I would so appreciate it. I do use Firefox and I went to add/remove to see which version and could not find the Adobe 10.1.82.76 it said I had??? Then I just went back and it is there. I was told I HAD to update the Adobe because of a security issue, but when I went to add it, it said warning the program I was about to add might be dangerous????? So I have it on the down load thing, I have not told it to run, but it shows up in my add/remove folder and I am SO confused??? Do I need to run it? I went to the adobe site and found it when I could not find the "edit" button. I am not sure if I have the right version. It said certain versions would not run with Firefox and I do not want to mess up my computer.
    Please advise
    Sheila

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    # Shockwave Flash 10.0 r32
    # Java Plug-in 1.6.0_07 for Netscape Navigator (DLL Helper)
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

Maybe you are looking for

  • Request to use microphone and camera's

    Please help each time I access a site to use a webcam ad microphone, I get the pop up message requesting the site to use the devices ..the option to allow or deny the use of the devices . I have changed the settings to allow these sites access but as

  • Footnotes - Some not importing from Word.

    Hello, using CS6 here. I am currently designing a 400 page book using a fully formatted Word file. I am importing the file into InDesign and setting all of the options properly-however after chapter 4 the footnotes disappear and are no longer in the

  • In ps express cannot open tiff files...

    ... in ios 7.0.4 iphone 5, while the same files can be open by ps touch with no problem, as it was in ps express until ios 6. when i open the tiff files with other post production app, worked and saved, then the files can be open by ps express. i hav

  • SNP quota arrangement with fixed lot size

    Hi all, i have a question regarding quota arrangement for external procurement in snp heuristic. Whe have 2 sources of suppy created by info record. The quota is 25% for the first and 75% for the second one. In product master there is maintained a fi

  • Can't update firmware on WRT54G

    I downloaded new firmware for my WRT54G. It currently has Firmaware version 1.00.60. The router was purchased at Best Buy for use with Vonage but I no longer use the phone part of the router. I downloaded the latest firmware from the Linksys site (4.