Forcing Windows focus on a JFrame

How do I force a JFrame to be displyed on top of everything else on the Windows desktop, i.e., a Java program running in the background needs to "pop-up" an error JFrame arbitrarily on top of anything else that is displayed.

Ok, this works fine:
    this.addFocusListener(new java.awt.event.FocusListener() {
          public void focusGained(FocusEvent e) {
          public void focusLost(FocusEvent e) {
              requestFocus();
    });where this is the JFrame to gain the focus.
Thanks, fstream. ;-)
But, I've found another problem... When I move the mouse pointer out of the JFrame wich I want to got focus, and this point is over a Component wich have tooltip text(i. e., a table cell), then the focus is setted on the JFrame wich contains this Component.
Any idea to prevent it?
Thanks in advance one more time. ;-)

Similar Messages

  • OS 10.6.4 losing application window focus across a bunch of apps

    Hi
    My iMac (10.6.4) has started doing something odd - it loses the application window focus in a range of different applications:
    The application stays in focus, but the current window loses focus. (You can see in the 'Window' menu for that app when it's done it that no window has focus). It happens when you're typing OR when you're doing nothing.
    It's affected at least Safari and iTunes, and i think, Entourage.
    There are no unusual apps running that I'm aware of: at least from the 'Force Quit' menu.
    Any ideas?
    (I'm using wired keyboard and mouse, and have switched USB ports for each, just to test if that was the prob)

    Bob: as you may have seen on the original post I did install the updates.
    That got the programs starting again, but trying to be productive is doing nothing but cause more crashes. I haven't seen something this bad and annoying in years. 
    I tried to simply copy a graphic in AI and place it as a Smart Object into a Photoshop layer. AI immediately crashed and PS froze. Had to do a force quit on PS. 
    Next I tried to do a save as with an AI file and it crashed the program. I'm totally crippled and very frustrated--as is my client needing the work done. 
    Simply put--why are Adobe CS programs crashing? The patch didn't solve the problem and I'm seeing a rash of discussions about crashes. What's the solution? What's the best way to get a real-world Adobe person to help me? 
    Geez what a mess.

  • Problem with new firefox tabs and window focus

    Here's a problem that I've had for ages - sometimes it annoys me, other times I can live with it. Right now it's really p***ing me off.  :x
    I have selected 'a new tab in the most recent window' under FF's Preferences->Tabs->Open links from other applications in:, so as an example, if I click on a URL in a mail in Thunderbird, Firefox opens it in a new tab. However, window focus stays on Thunderbird. I run both of them full screen, so although I'm looking at the web page in Firefox, anything I do on the keyboards affects Thunderbird. It affects URLs opened from other apps too e.g. if I open a terminal and do
    firefox www.archlinux.org
    focus stays on the terminal window. The only exception is when firefox is not already running - in that case, firefox launches with focus.
    DE is xfce4, and the system is completely up to date.
    I've done some googling, and AFAICS, nobody else seems to have this problem. Any ideas, anyone?
    TIA.

    Thanks MAC!EK - definitely a useful add-on, but it still doesn't solve my problem. In Tab Mix Plus Options, I have the following selected:
    Links -> Open links from other applications in: New tab
    Events-> Tab Focus -> Focus/Select tabs  that open from: <all>
    However, the behaviour is as before i.e. I click a URL in Thunderbird, it opens in a new tab in Firefox, but window focus stays on Thunderbird. Within Firefox, the newly-opened tab is selected or focussed, but Firefox itself is not.
    Anyway, thanks again. I think I need to keep looking.

  • Window Focus Lost After Saving Page - Any Way To Get It Back With Keyboard?

    I've recently begun using Safari for Windows after having used Opera for years, and have run into a problem with window focus that I didn't have with Opera. Specifically, if you save a web page in Safari, you then find that the following functions are no longer available from the keyboard:
    1. Going back to a web page previous to the one that you just saved. Ctrl+[ does not function.
    2. Performing a search. Ctrl+F does not function.
    3. Scrolling to the bottom or top of the page. Ctrl+End and Ctrl+Home do not function. (For some reason, however, the PageUp and PageDown keys do still work in this situation.)
    Why is this, and more importantly, is there a quick and easy way that you can, using only the keyboard, regain the window focus so that these functions will work again? I'm currently having to click somewhere on the page I've just saved in order to regain the focus. This is a nuisance.
    Thanks for any advice.
    George
    Message was edited by: safwin

    Thanks very much. Hitting 'Alt' button after saving the page does resolve the first (and most important) two of the three issues I listed above. FWIW, the Ctrl+End and Ctrl+Home functions only work in this post-save scenario (as I discovered by experimenting a few minutes ago) if you hit the 'Alt' button twice (or if you do something else, like perform a search and then use Ctrl+End/Home).
    By the way, before posting a few days ago, I had tried using the Alt+Tab method when I had two or more applications' windows open, and it didn't help. But, after reading your last post, I've found that if you use Alt+Tab when Safari is the only window open, then it does resolve the issue, although of course, as you've indicated, it's not actually necessary to hit the 'Tab' key.
    Thanks again!
    George
    Message was edited by: safwin

  • Problem with onBlur="window.focus()"

    Hi,
    inside the body tag of a popup widow i have used onBlur="window.focus()" and it is working fine i.e. when i tried to click on parent window the focus transfers back to popup window but i tried this by clicking like hundred times it fails i.e. the focus transfers to parent window.
    Does this function depends on number of click.
    manish

    Hi,
    No the problem is still there and it is not related to no of clicks because today for the just first time it failed.
    U have written
    "except maybe you can use onBlur and onFocus to set a variable to indicate the state and use setInterval to constantly check that every couple seconds as a backup to push it forward."
    i have not used this setInterval. ok let me tell u how i have used.
    In the parent page when it popups a window i have set a flag(global var.) to true and in the body tag (of parent itself) i used "onFocus="javascript:chkChildWin()""
    <script language="Javascript" >
    function chkChildWin()
    if(childFlag)
              cal_setFocus()// method to set the focus to popupwindow
    </script>and inside the popup window body tag i used
    onBlur="window.focus()"
    when user selects some thing from popup window or it closes the popup window then variable is reset to false. and as it is clear from the above mentioned code that parent window checks this flag on its focus method.
    sometimes it work fine and sometimes it does not.
    I don't know how to solve a problem which is not consistent, i mean this occurs randomly.
    plz help me out
    manish

  • Significant Computer Window Focus Problem With Verizon Access Manager 7.7.1.0 (2707e)

    With the newly released Verizon Access Manager 7.7.1.0 (2707e) there is a significant computer focus problem with it.
    What I mean by this is that if I am using ANY application on my computer with the Verizon Access Manager minimized to the Windows System Tray, something will go on with the Verizon Access Manager and it steals the window focus - I am unable to work in the other application unless I click on the application to use it again.  
    An example of this would be my typing to post a message in this forum.  Something occurs in the Verizon Access Manager and my typing is rendered useless unless I click with my mouse on the browser window to be able to use it again.
    I'm highly suspecting whenever networks are coming and going in the Access Manager is when the problem occurs.
     This problem did not exist in the previous version of the Access Manager I was using.
    This is extremely annoying - please issue a fix for this ASAP!

    I have found by not minimzing the Verizon Access Manager 7.7.1.0 (2707e) the focus problem does not occur - it appears to be a problem when the app is minimzed to the system tray.

  • Acrobat looses windows focus after showing a wxWidgets modal dialog

    Here's a code sample:
         AVWindow dlgWindow = AVWindowNewFromPlatformThing(AVWLmodal, NULL, NULL, gExtensionID, dlg->GetHWND());
        AVAppBeginModal(dlgWindow);
        dlg->ShowModal();                                   // dlg is a wxDialog*
        AVWindowDestroy(dlgWindow);
        AVAppEndModal();
    This works in so far as the wxWidgets window is modal with respect to Acrobat, however when we do AVAppEndModal Acrobat does not get the windows focus back.  In fact some other open application gets it instead, which is a problem for the end user.
    If I take away the Begin and End, I do not get the focus problem, however I do not get the modal nature either.
    Any ideas on how to solve this?
    Thanks
    Simon

    Hi,
    I see this too.
    The only workaround I found is to use Windows api to find the Acrobat window and switch back to it maually. There is a flicker, but at least the user is back in his original window.
    I can confirm this behaviour on Wndows XP, Vista, and 7 in Acrobat 8, Acrobat 9 and Acrobat 10.
    Simple code that works for me:
    void SetWinFocusBackToAA()
        #ifdef WIN_PLATFORM   
            if (gHWND) SetForegroundWindow(gHWND); //AA 8 MDI
            else
                HWND AAhwnd = FindWindow(L"AcrobatSDIWindow", NULL);
                if (AAhwnd) SetForegroundWindow(AAhwnd);
        #endif
    I do not see such a problem on Mac OS X.
    I suspect the problem lies in setting correct parent for the modal window, but I have not been able to find one (for some years now).
    Also this does not happen when the modal wx dialog is a child of another wx windows (a modeless window).
    Polda

  • Firefox frequently loses window focus

    It seems that Firefox frequently loses window focus when I open a new page. It may be a bookmark, a link opened into a new tab via CTRL+Left-Click, or whatever. The following scenario always results in the window losing focus (for me).
    # Open Firefox.
    # [http://www.foxnews.com Open this link and bookmark it].
    # Close and reopen Firefox.
    # Open the page just bookmarked using the bookmark list and don't touch the window.
    I read this page daily, so when I start Firefox and open the page, I have to click in it so as to scroll, etc..
    Firefox 13, Windows 7 Home Premium 64-bit
    I wish this site had "Preview" for its posts. Geez Louise.

    Oh please fix this ******* issue, it is driving me mad.
    ''Edited by a moderator due to language. See the [http://support.mozilla.com/kb/Forum+and+chat+rules+and+guidelines Rules & Guidelines] .''

  • Lasso tool problem, using alt key, no click within 5sec causes loss of active window focus

    I have been using Photoshop since ver. 4 and have never seen this happen.  The only difference is now I'm on Windows 7 64bit.  Did not have this problem with XP.  Current version CS3 Extended.
    Problem: While using Lasso tool with the alt key if I do not make a mouse click in 5 seconds Photoshop's active window loses focus for a split second and then the first point of my selection and the last point will connect.  Thus, wasting my time and my attempt at a selection.
    I have task bar buttons to "Never combine".  I see for that split second what appears to be another program button opening but it is so fast that I cannot see if there is a name on the task bar button.  The current Photoshop button moves to the right and back too fast.  This all happens very quickly as the window loses focus.
    I first thought it was some another program but after many searches found nothing I can identify as the cause.
    Right before posting this I had a thought and did a test that concluded in the 5 sec rule. For over a minute I held down the alt key and made a mouse click within the 5 second window of time and there was no loss of window focus.  While still holding down the alt key in this same test but not making a mouse click within 5 seconds the window lost focus and the tool stopped with my selection.
    I have a wireless Logitech M305 mouse that this morning updated the driver to its current version 5.20.51, Control Center version: 6.20.50.
    I have not tested a wired mouse, yet.
    Any help would be appreciated.  Anyone else seen this?  Windows 7 64 bit the culprit?????
    Message was edited by: golfnut333

    UPDATE
    After I removed Photoshop from Norton 360's Administrative Settings_Silent Mode Settings_User-Specified Programs, I did not have the problem with the lasso tool that I first had with loss of window focus.  I then put Photoshop back in the 360's settings and the lasso tool still worked, BUT...............
    After a couple of days of not using Photoshop and turning computer on and off in that time, I tried Photoshop again and the same problem, it came back.  Loss of focus after 5 seconds of not clicking mouse.  So, once again I open Norton and took Photoshop out of the User-Specified Programs and the problem went away, no loss of focus.
    So, I will see if after a couple of days of turning on and off the computer and NOT putting Photoshop in the Norton's User-Specified Programs setting if the problem stays fixed.
    I don't have to have Photoshop in the Norton's setting I just thought that it would be a good idea so Norton didn't try to do any background processes or whatever while I was working in Photoshop or I was rendering a filter or something.
    Another thought I also have the Full Screen Detection setting ON.  I do use Photoshop in Full Screen mode so maybe when having both the Full Screen mode and User-Specified Programs setting selected it makes something go wacky.
    Hope this helps anyone having the same problem I "did".  Will post back after a few days to let you know if focus problem is gone.
    If it does relieve the problem then I will leave Photoshop off the list in Norton.  No sense in trying to fix something that really doesn't matter, really.
    UPDATE 2
    January 8, 2011, I tried the lasso tool again and it still appears to be working. I did my standard test of holding the alt key and clicking to make selections then not click for 5 seconds or more and I did not lose window focus.  I do not know why the Norton 360 setting triggers the loss of focus but since I turned that setting off I'm not having any problem.
    Will update again if something changes.
    Anyone else out there with the same problem that was solved using this method?
    Message was edited by: golfnut333

  • ACR to Photoshop CS5 window focus problem.

    Running Photoshop CS5 on Win7, both 64 bit. No problems for months, then recently this minor "annoyance" appeared.
    I "host" ACR via Bridge, with the windows for all three apps maximized. I double-click a raw file in Bridge and ACR opens. I make my ACR adjustments, or not, and click "Open Image" to pass to Photoshop.
    The images passes into Photoshop OK, but the Photoshop window does not receive "focus". Instead, the ACR window closes, leaving the underlying Bridge window displayed. But then no window has focus.
    When I click once on the Photoshop tab, I get a screen flicker, like a window is being minimized, but the Bridge window remains displayed. I click again on the Photoshop tab and it comes up, full screen with focus.
    If I take the ACR window out of "maximized" mode, the problem does not occur. Raw images pass from Bridge through ACR to Photoshop with proper window focus. Opening tif, psd, or jpeg images via Bridge is no problem. Only when raw images pass through a maximized ACR window does Photoshop fail to receive focus.
    A few days ago I used the Windows 7 "snap" feature to place the Photoshop window and ACR window side-by-side. This is done by dragging a window off-screen until it turns blue and then releasing. I believe this action caused the problem I'm having now. I've unsnapped, resnapped, and unsnapped the Photoshop and ACR windows several times, hoping to clear the problem, but it remains.
    Keeping the ACR window out of maximized mode is an easy work around, but the mystery remains and I hate mysteries.

    I know how you feel, I've had a few problems like this with CS5. I can only think of two suggestions:
    1. Disable Windows 7's fancy desktop (Aero peek, or whatever it's called) to see if that helps.
    2. Make sure you're sorting by filename in Bridge. I have noticed that sorting by metadata causes Bridge to sometimes steal focus when it's not wanted. I love Bridge, but christ it needs a good sorting out.

  • Something is briefly stealing the window focus

    Dear all,
    At least 50% of the time, I'm typing in an xterm on my computer.
    There's something running that's stealing the window focus away
    from my xterm where I'm typing for about 1/2 a second and then
    returning it to my xterm. This is very annoying if it happens
    while I'm typing. Unfortunately, I have no idea what's doing it
    and can't give a simple recipe to reproduce the problem.
    I have a vague suspicion it might be related to the Thunderbird
    mail client, since sometimes my "you have new mail" alert sounds
    right after it happens, but I can't prove it.
    Any advice on how to fix this would be great.
    Thanks,
    Owen

    Turn off the new mail alert and see if that solves the issue. FWIW, although not xterm, when I'm using the Terminal, Eudora's new mail alert doesn't steal focus. For xterm issues, post to the Unix forum under OS X Technologies.

  • X11 Window Focus Problem Driving Me Crazy

    Hello,
    For no reason that I can figure, I'm having difficulty in OS X with the window focus. In the gimp, or inkscape or any other X11 program, when I click on a button, after about a second, the focus of the window is temporally lost. I've uploaded a video to show the problem more exactly:
    http://www.screencast.com/users/grey1618/folders/Jing/media/d826455a-9657-4409-b 085-a8a1b3c5ca19
    If you watch the close, minimize and plus button on the top of each window after I click each tool you'll see what I mean.
    Any help would be really, really appreciated.
    Thank you,
    -Grey

    Best you post to the Unix forum under OS X Technologies where the Unix, Terminal, and X11 mavens congregate.

  • Adobe shock wave flash is causing Mozilla Firefox to lose window focus.

    WhenI leave a website open in Mozilla Firefox and then shut my laptop and leave it over night, then turn on my laptop the next day and open Mozilla Firefox and start using it my window loses focus so that I can't scroll or type without clicking somewhere on the screen to regain window focus. I am running windows 8.1 with the most recent version of the schockwave flash plugin. (17.0.0.169). I am also using the most recent and updated version of Mozilla Firefox. Why am I losing window focus? It seems to only happen after starting up my computer after leaving a webpage open from the day before.

    I think Adobe might have solved this by now, but there used to be a problem where when you launched a new window using Flash, you would get switched to a different window. The workaround was to disable the protected mode feature of the Flash player plugin. It has security benefits, but seems to have compatibility issues on some systems.
    The old instructions were somewhat arduous; fortunately, there is a new hidden setting for this:
    (A) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (B) In the search box above the list, type or paste '''flash''' and pause while the list is filtered
    (C) Double-click the '''dom.ipc.plugins.flash.disable-protected-mode''' preference to switch its value from false to true.
    This might not take effect until all Flash has been unloaded for a few minutes, or you close Firefox.
    Before that preference was added, the way to disable protected mode was by creating or editing a settings file. The following pages/posts provide different approaches for that if it turns out to be necessary (if Flash EXE processes continue to show up in the Windows Task Manager, Processes tab, even after changing the Firefox preference):
    * Adobe support article under the heading "Last Resort": [http://forums.adobe.com/message/4468493#TemporaryWorkaround Adobe Forums: How do I troubleshoot Flash Player's protected mode for Firefox?]
    * Manual steps: https://support.mozilla.org/questions/968190?page=5#answer-509209
    * Batch file to automate the manual steps: https://support.mozilla.org/questions/982093#answer-518078 (alternate version of Carm's batch file with a few changes by me: [https://onedrive.live.com/?cid=f7d304d92388737d&id=F7D304D92388737D!336&ithint=file,.bat&authkey=!AP2FXW2Y_3BXZyo])
    Flash needs to completely unload from memory (exiting and starting Firefox up again might help) before this takes effect.
    Any improvement?

  • Force window applications

    Hi all,
      I need any application where force window is used.
    I am doing project on labview, so for some part of the project i need any vi (application vi) where force window is used.

    Hello sir,
      force window is there in signal processing tool box- Windows- Force.
    I need any application where this window is used.
    for example please find the attachment, here they have used many windows like hamming, hanning and welch etc.
    i need application where only force or welch window is used.
    Attachments:
    examplewelch.vi ‏40 KB
    example.jpg ‏2305 KB

  • Windows Live Mail could not be started. Closing Windows Live Mail. Your calendar contains corrupt data that is forcing Windows Live Mail to close. (0x8E5E0247

    Hi
    Can you please HELP??
    I recently had to change my hard drive for my laptop (Sony Vaio). The IT guy replaced my HDD and ghost all my information
    from old to new drive. Everything works perfect except for Windows Live Mail.
    When I open WLM I get this error:
    “Windows Live Mail could not be started. Closing Windows Live Mail. Your calendar contains corrupt data that is forcing
    Windows Live Mail to close. (0x8E5E0247)”
    I have since done the following:
    PROBLEM SOLUTION 1:
     1. Close Windows Live Mail and any other Windows Live programs.
     2. Click Start (then Run for
    Windows XP), paste the following path below and press Enter:
    %Localappdata%\Microsoft\Windows Live Mail\Calendars
    3. Rename the folder of the account you use to sign in to Windows Live Mail to
    sync your calendar (ex. rename [email protected] to [email protected]).
    4. Restart your computer for the changes to take effect.
     5. Launch Windows Live Mail again.
    THIS DID NOT WORK SO I DID THE FOLLOWING:
    PROBLEM SOLUTION 2:
    I removed WLM (uninstall) and reinstalled and still nothing.
    PROBLEM SOLUTION 3:
    I also renamed the WLM folder and reinstalled WLM, then deleted the new WLM folder and still nothing.
    PROBLEM SOLUTION 4:
    I also tried to import my emails from WLM to Microsoft Outlook but I only have a copy of my mails from the directory. 
    I do not have an EXPORT copy saved anywhere. Is there any way I can export the WLM to Microsoft outlook?
    PLEASE HELP I AM AT WITS END.

    I have had many problems with permissions on Windows Vista, 7,8 & 81.1.  It is usually after an update or installation, especially one that requires a reboot to finish (some AVG, Windows Live, Windows Updates, etc).  Once File(s), Folder(s)
    and Registry Key(s) permissions are screwed up, it can take days to work them out if ever.
    After having spent several hours on a clients PC and online forums with this problem.  I transferred her user profile with a free program called
    Transwiz (run as Administrator) to a zip file on the HDD.  I renamed her user in manage User Accounts to "Username old".  I then ran Transwiz again to restore the profile but telling it to create a new user using the original Username.
     After it completed restoring the profile, I logged out of "Username old" and logged in to Username and all wass well, I only needed to supply the email password which is not transferred.  When you move profile data, all the old permissions
    have to be removed and <st1:personname w:st="on">new</st1:personname> permissions added so the data and files belong to the <st1:personname w:st="on">new</st1:personname> user.  This cleared up all the permission
    problems.
    James Taylor

Maybe you are looking for