Browser window focus

Can anybody think of a reason why doing a requestFocus on a JPanel-subclass terminal emulation panel in an Applet would fail to get the keyboard focus back to the emulation panel, much less bring the browser window back to the front? The emulation panel in question handles all of its own keyboard and mouse input, and this is occurring after a non-modal JDialog (which I very specifically do NOT want to give focus to) is popped up with the Swing default owner frame as its owner. (The whole point of popping up a non-modal dialog, and immediately taking the focus away from it, is to provide a convenient, movable, top-level container, without wasting valuable title-bar space on minimize or maximize buttons, in which to display an image.)

I think that that's just the nature of the food-chain. It works much the same way that the browser's document window loses its ability to trap an event if that very same event is being trapped by an applet contained in the browser's window. I suspect that while you cannot programmatically give focus to the terminal emulation panel, it is possible for the user to click and give focus to the panel. What you might want to do is to create a popup that doesn't require a user's response.
V.V.

Similar Messages

  • Browser window focus behaviour

    Hey all, I am not sure if this is the most correct form for this, so feel free to let me know if there is a more appropiate one....
    Within my organization, Sun Java is really causing a lot of frustration with how some of our web pages are working. The scenario is this...
    1) user views details regarding a specific issue on a web page
    2) user enters some data in textbox and then clicks button to email someone else
    3) pop-up is displayed for the user to enter data for email
    4) original page 'reloads' itself, which Sun Java then seems to cause it to steal focus again.
    5) user thinks email window is gone, even though it has only moved behind original window.
    Sometimes it takes a couple of seconds for the original window to steal the focus back, it there is a lot of data to display, so the user could already be typing in things, and then have a different window take focus.
    We need to maintain some sort of 'reload' on the original page, in case any data changed on the page before the user clicked on the 'email' button, or other buttons, etc.
    Our users are VERY annoyed by this. If we turn off Sun Java and use the MS jvm, it works fine. For some web apps, we need Sun Java though.
    Users are on a variety of Sun Java versions, 1.41 to 1.5. at the least.
    Any ideas on how I can change this behaviour?
    Thanks,
    Craig

    I think that that's just the nature of the food-chain. It works much the same way that the browser's document window loses its ability to trap an event if that very same event is being trapped by an applet contained in the browser's window. I suspect that while you cannot programmatically give focus to the terminal emulation panel, it is possible for the user to click and give focus to the panel. What you might want to do is to create a popup that doesn't require a user's response.
    V.V.

  • Using web.show_document the first time makes new browser window lose focus

    Hi,
    In our application we use show_document(url, '_blank') to open our reports (as pdf) in a new window.
    Our environment is Application Server 10g Release 2 with Forms 10g Release 2 and jinitiator 1.3.1.22.
    The first time I call a report, the new browser window containing the pdf is shown but loses focus after about 1 second. The focus is then returned to the applet window. When calling a report again it always keeps the focus.
    After closing the applet window and restarting the application, the same thing happens: first report called loses focus, all others keep the focus.
    Does anyone have any idea why this is happening? We want the focus to stay on the new browser window every time...

    Hi Jeroen,
    I m also facing a problem something similar to yours. If you got any solution please let me know.
    Problem-
    Currently my application is running on Forms 9.0.4.2 and my form calls another third party which displays the image in image viewer in new browser. When user clicks on the button to display image, then I m using the following Code -
    -- Method: displayDocuments ([Ljava/lang/String;)Ljava/lang/String;
    FUNCTION displayDocuments(
    obj ORA_JAVA.JOBJECT,
    a0 ORA_JAVA.JARRAY) RETURN VARCHAR2 IS
    BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
    RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'com/hli/imaging/adapter/LK_FormsImagingAdapter', 'displayDocuments', '([Ljava/lang/String;)Ljava/lang/String;', args);
    END;
    Image is displaying fine but the focus is staying on the newly opened browser. I want it to get back the focus to the forms window.Is this possible ???
    Thanks in advance
    Sai                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Giving Stage Focus When First Opening In Browser Window - How??

    Is there any reliable way to give the stage focus when you first open it in a browser window WITHOUT first clicking on the stage? By reliable, I mean something that works across different browsers and on both PCs and Macs.
    I've seen numerous threads on this subject, and I've read the Adobe tech note, and it seems there is no reliable way. This is a joke, right???? How in the world can Adobe ask people to use Flash and not provide a reliable way to give the stage focus on startup. Requiring the user to click on the stage first is totally stupid.
    Has this problem been solved since all the other threads were posted, and if so, what's the solution?
    Thanks.

    for online swfs, it's a security issue and there's no reliable way to do it.  for local files, it's straight-forward.

  • Window with applet tag gains focus prior to new window browser window

    setup a :
    1. sample index.html page:
    <HTML>
    <HEAD>
    <script>
    var _load=function(){window.open('test.html');};
    window.attachEvent("onload", _load);
    </script>
    </HEAD>
    <BODY>
    <applet code=Index name=Index width=1 height=1 align=baseline>
    </BODY>
    </HTML>
    2. and child test.html window of the above (opened during onload event)
    <HTML>
    <HEAD>
    <TITLE>1</TITLE>
    <script>
    var _load=function(){window.focus();};
    window.attachEvent("onload", _load);
    </script>
    </HEAD>
    <BODY>
    TEST PAGE
    </BODY>
    </HTML>
    when a test.html page is opened focus is temporarily shifted back to the index.html page and
    only later back to the test.html page (window.focus()) call in that page sets the focus, not always
    suceeds, a further code is required to do a retry)
    when the applet is removed from the index.html page, problem goes away, it is if the applet tag
    has priority in terms of window focus
    byproduct of this is also annoying flicker, (while the focus is shifted between index.html and test.html page)
    this problem is only happening with SUN JVM (and I dont know if its a defect or by design)
    SUN JVM tested:
    Java(TM) Plug-in: Version 1.4.2_03
    Using JRE version 1.4.2_03 Java HotSpot(TM) Client VM
    suggestions, workarounds? appreciate in advance

    tested following matrix of browser/VM
    Platform Result:
    MS IE and Microsoft (R) VM for Java, 5.0 Release 5.0.0.3810 (with success, no focus problems)
    MS IE and Java(TM) Plug-in: Version 1.4.2_03 (focus problems, in the case of
    two applets one coded on the
    main page the other on the pop-
    up window)
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
    Plug-in: Version 1.4.2_03 Using JRE version 1.4.2_03 Java HotSpot(TM) Client VM
    (focus problems, in the case of one applet on
    the main page or in the case of two applets
    one coded on the main page the other on the
    pop-up window)
    Please see revised test case source code (to support above configurations, as well inclusion of the second
    applet to address discrepency in behaviour between Mozilla and IE (with SUN JVM)
    <HTML>
    <HEAD>
    <script>
    String.prototype.contains=function(s){return(this.toLowerCase().indexOf(s.toLowerCase())!=-1);};
    var u_n=navigator;
    var u_agt=u_n.userAgent.toLowerCase();
    var u_MSIE=(u_agt.contains("msie"));
    var _load=function(){window.open('test.html');};
    if (u_MSIE)
    window.attachEvent("onload", _load);
    else
    window.addEventListener("load", _load, false);
    </script>
    </HEAD>
    <BODY>
    <applet code=Index name=Index width=1 height=1 align=baseline>
    </BODY>
    </HTML>
    <HTML>
    <HEAD>
    <TITLE>1</TITLE>
    <script>
    String.prototype.contains=function(s){return(this.toLowerCase().indexOf(s.toLowerCase())!=-1);};
    var u_n=navigator;
    var u_agt=u_n.userAgent.toLowerCase();
    var u_MSIE=(u_agt.contains("msie"));
    var _load=function(){window.focus();};
    if (u_MSIE)
    window.attachEvent("onload", _load);
    else
    window.addEventListener("load", _load, false);
    </script>
    </HEAD>
    <BODY>
    TEST PAGE
    <applet code=Test name=Test width=1 height=1 align=baseline>
    </BODY>
    </HTML>
    Index.java source code:
    public class Index extends Applet {
    public synchronized void init() {
    public synchronized void start() {
    public synchronized void stop(){
    public synchronized void destroy(){
    Test.java source code:
    public class Test extends Applet {
    public synchronized void init() {
    public synchronized void start() {
    public synchronized void stop(){
    public synchronized void destroy(){

  • Browser window gains focus :-(

    Hello,
    I am starting an applet... this applet loads data from the server, which is came from. After its gets the data it visualize a JFrame... so no JApplet window appears in the browser window... the JFrame is the actually user window....
    Under Mac OS X it runs fine... but under Windows XP SP2, Firefox, IE 6, Java 5 latest I do have the problem, that the browser window, which the applet loads comes in foreground when the JFrame is set to visible.... I have to click on the JFrame to use it...
    has anybody an idea how I can give the focus the JFrame and not the browser window under windows? That would be nice....
    Thanks guys.

    Maybe toFront()? Saw it in the API, it looks appropriate, but I haven't tried it myself.

  • Open .swf in full-screen browser window?

    Hi there! I would appreciate if someone could help me with this:
    I have a .swf that I embed in an .html file. When loaded, the html file opens up in a window with the application taking up only 50% of the window. I'd like to have the application open in a window that's full screen. Is that possible at all?
    The .html file I'm using is a standard one generated by Captivate and looks like this:
    <!-- Copyright [2008] Adobe Systems Incorporated.  All rights reserved -->
    <!-- saved from url=(0013)about:internet -->
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Title</title>
    <script src="standard.js" type="text/javascript"></script>
    </head>
    <body   bgcolor="#ffffff">
    <center>
        <div id="CaptivateContent"> </div>
        <script type="text/javascript">
           var so = new SWFObject("myfile.swf", "Captivate", "891", "551", "10", "#ffffff");
            so.addParam("quality", "high");
            so.addParam("name", "Captivate");
            so.addParam("id", "Captivate");
            so.addParam("wmode", "window");
            so.addParam("bgcolor","#ffffff");
            so.addParam("menu", "false");
            so.addVariable("variable1", "value1");
            so.setAttribute("redirectUrl", "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash");
            so.write("CaptivateContent");
        </script>
        <script type="text/javascript">
            document.getElementById('Captivate').focus();
            document.Captivate.focus();
        </script>
    </center>
    </body>
    </html>

    Hi,
    What do mean by browser window?
    If you mean the File>Open dialog, double click on the Title bar to get it back to a smaller size.

  • Opening a new browser window in APEX

    Hi.
    I am trying to open a new browser window in APEX (v2.1) for a new Navigation Bar Entry.
    What I did is the following:
    1) Created the new Navigation Bar Entry
    2) On the properties of this entry I put the Target Type: "URL"
    and on the Target: javascript:window.open('f?p=&APP_ID.:63:&APP_SESSION.:::::' , 'Despre','scrollbars=1,resizable=1,width=400,height=600');
    when I click on my Navigation Bar Entry, the page 63 opens on the same window,NOT on a NEW browser window.
    Can you please help ?

    It seems that I found the answer.
    I had to do the following:
    javascript:(window.open('f?p=&APP_ID.:63:&APP_SESSION.:::::', 'Despre','Scrollbars=1,resizable=1,width=400,height=600')).focus();
    and then logout and login back in the application and it worked.

  • Issues showing PDF files in web-browser (Windows 7 x64, 32-bit version of AdobeReader X)

    I'm not sure if this is the right way to share my experience, but at least I know Google will discover this thread eventually and maybe someone else will find what I have been looking for the past 3 hours
    I'm deploying the 32-bit based AdobeReader X (http://www.adobe.com/support/downloads/detail.jsp?ftpID=4950) to Windows7 32-bit and 64-bit based machines. This is a MSI deployement done through our Active Directory. Everything goes well - no errors. Except for the x64-based machines having trouble showing PDF-files in the web-browser.
    I used Adobe Customization Wizard X to customize our MSI installation - this showed out to be the solution once again.
    Common for the installation on Windows7 32-/64-bit were that the value in the registry database for HKCR\Software\Adobe\Acrobat\Exe (Default) was set to "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe". This is valid for the 32-bit installation as Program Files is situated in C:\Program Files, but since it's a 32-bit edition of AdobeReader that I'm installing on the 64-bit based system as well, it's installed in C:\Program Files (x86) and the reference in the registry database to "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" is therefore not valid - which explains why PDF files could not be displayed in the web browser. Changing the registry to "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" solved it. Now this is a manual solution which might be useful on 1-2 machines but on a bigger scale it's not the right way to do it.
    I could change it with a batch/vbs script but still this is only a solution of the symptom and not a solution to the core issue. I therefore focused on Adobe Customization Wizard X again.
    The problem was easily solved. I opened the MSI file, loaded the transform file that I've made previously. Went to Registry > HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe . I then changed the (Default) value from "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" to "[INSTALLDIR]Reader\AcroRd32.exe", generated the MST file and replaced my current one for distribution. Problem solved! :-) The entry in the registry now shows : "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" and PDF files are open without any issues.
    I hope someone can save a bit of time on this one.
    Best regards!
    Alex Mikkelsen

    I was able install and view the files in adobe reader 10.1.1 and in web browser window 7 64 bit machine.  But when I go to Edit-preferences-internet and  unchecking "display PDF in Browser" , I am not able to view the pdf files in ie 9 browser.  I have used this javscript to check for pdf version.
    Immediately after installing adobe--
    when I do adobe test in ie 9---https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html--  launches a test pdf file--Acro_Test.pdf
    After unchecking-- it stays in the  https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html instead of showing test pdf file--Acro_Test.pdf
    Tried to go back to "display PDF in Browser"--it is showing it is checked(eventhough I did not check it)
    and in ie
    it stays in the https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html instead of showing test pdf file--Acro_Test.pdf

  • Opening a browser window from a CHM (Win7)

    Hi All,
    I'm having a problem where a script we've had for years to open a special window (sized, no browser buttons, etc) for certain content is no longer working correctly in Windows 7.
    Here is the script:
    function OpenWindowSize(strUrl, u_width, u_height) {
    var w_width = ",width=" + u_width;
    var w_height = ",height=" + u_height;
    var strOptions = "scrollbars=yes,resizable=yes"
    strOptions += w_width;
    strOptions += w_height;
    strOptions += ";";
    var newWin = window.open(strUrl, "newWin", strOptions);
    //     newWin.document.close();
      newWin.focus();
    WinXP & Vista: a link within a CHM correctly opens a new window with only scroll bars, and resizable, with the specified dimensions (e.g. u_width=500, u_height=700)
    Win7: a link opens in a regular browser window with full menus, etc and not sized to the specified dimensions. An error also displays in the CHM file.
    CHM error message (snippet): 'newWin' is null or not an object.
    A developer managed to get the CHM error to go away by adding if (newWin != null) above the focus() line.
    He also managed to prove that the problem only exists within CHMs. When the same javascript is used in plain HTML, the window is called correctly, as per the WinXP & Vista example above.
    Does anyone know how to get my script working in Win7 so that it is sized correctly and doesn't have the menus/buttons?
    Thanks,
    Amber

    Hey All,
    I just got a message from PatricioV2, for this...I totally forgot to come back to the forum...I was so busy trying to work out the solution that now, I forget the specifics, but I did find out that there is NO WAY to customize a pop-up window from a CHM with IE 9 or 10 installed...any pop-up will have ALL the browser timings. And since I didn't want that effect, I abandoned that idea and pursued a different solution.
    However, I was able to use jQuery Colorbox...which really surprised me. But even with this, you cannot use "linked" images from the stylesheet so the controls don't show...so, you need to "style" the elements with color values (i.e. background, borders, etc.).
    Also, and very important, if your content is in an IFRAME in the CHM (which mine was), you MUST use a jQuery technique to get your colorbox to work on the PARENT window...otherwise, the colorbox effect will happen ALL INSIDE THE IFRAME...
    ...and on a side note: the code in the original post is very close to the code I was using...but all I needed to do was define the value of NULL and the script worked without any errors (which is in a post above)...but not being able to style the pop-up just ruined it for me...

  • Opening a browser window

    My issue is as follows:
    Our application consists of images and forms. We display the image in an image viewer, on left half of the screen and the form on the right half.
    When we display the image in a browser using web.show_document the image gets displayed fine but the focus remains on the newly opened browser window. The user has to click into the form to start entering information from the image into the form, losing valuable time in a high volume processing environment.
    Is there a way other than using web.show_document (foreign functions/Java/any other technology) that will allow me to open a browser window from the form and then send the control back to the form?
    Thanks
    SP

    Hi,
    check this one
    WEB.SHOW_DOCUMENT
    Frank

  • Opening a Browser Window with no Address Bar

    Hello All,
    I am working on an application which needs to open a new browser window. I need to hide the URL from the user.
    Right now, I can open the window with no toolbar or address bar with the following command:
    String cmd = "cmd.exe /c start javascript:window.open('http://www.google.ca','main','menubar=0,location=0,toolbar=0,personalbar=0,status=0,scrollbars=1,resizable=yes')";
    However, this first opens up a blank window and then the window with no address bar. If I make the command:
    String cmd = "cmd.exe /c start javascript:window.open('http://www.google.ca','main','menubar=0,location=0,toolbar=0,personalbar=0,status=0,scrollbars=1,resizable=yes';window.close();)";
    then the user is asked if they wish to close the first blank window.
    Does anyone know how to open a new browser window via the command line without the annoying extra window?

    It works with the following command but the new browser window isn't in "focus".
    cmd.exe /c start javascript:window.open('http://www.google.ca','main','menubar=0,location=0,toolbar=0,personalbar=0,status=0,scrollbars=1,resizable=yes');window.opener=top;window.close();
    Ryan

  • 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.

  • Need Help Centering Page in Browser Window

    I'm designing my pages by creating a graphic framework in
    Photoshop, slicing and exporting images into css using Fireworks to
    a Dreamweaver html page. These pages look great; but they load into
    the upper left corner of the browser window
    I was taking a Dreamweaver class at the Denver Art Institute,
    that was worthless. I dropped the class after the 4th week and am
    now teaching myself. I asked the teacher how to center this kind of
    page in a browser window, so the page would behave like most
    webpages, centering as you change the width of the browser window.
    I also wanted to add a repeating pattern in a background image. She
    told me that she didn't know how, that I would have to build the
    background into my Photoshop file. So, that's what I've been doing.
    However, when people with smaller monitors change pages within a
    site the built-in background requires them to recenter the page
    manually each time.
    Is there a way to center the page and add a background image
    that is not built in? I've tried using Dreamweaver's background
    image and margins in the Page Properties; but that just pushes the
    page to the upper left and adds the background to the right and
    bottom of the page.
    Please visit:
    http://www.livingwater.la,
    http://www.renegadegraphics.biz
    and
    http://www.dentalmatchmakers.net
    for examples.
    Thanks for your help.
    Mary

    >I was taking a Dreamweaver class at the Denver Art
    Institute, that was worthless
    Yes, those classes usually are worthless because they focus
    on using the tool without giving you the proper foundation for
    understanding and managing html and css. Unfortunately, all of the
    example sites you gave you AP Divs (layers) as a primary layout
    method, which is a terrible approach. AP Divs should be used rarely
    if ever, and only when you understand how they work. When the
    visitors font is sized differently than you expected, the site
    falls apart. The correct approach is to learn web
    design/development outside of the context of a specific
    application.
    http://www.w3schools.com/html/
    is a good place to start for a basic understanding of html and css.
    And some basic layout techniques can be found here:
    http://apptools.com/examples/pagelayout101.php

  • How to scroll within a datagrid without the browser window scrolling as well

    Hi,
    I have a datagrid with a vertical scrollbar. When the mouse
    is over the datagrid i'd like to use the mouse wheel to scroll
    through its contents. However when i do this the main browser
    window (which also has a vertical scrollbar) scrolls as well. How
    can i prevent the main browser window from scrolling when the mouse
    is over the datagrid so that only the contents of the datagrid
    scroll?
    Thanks

    I found some javascript code that solves this problem. Credit
    for the code has to go to the person who wrote the excellent
    article at the following link:
    http://www.switchonthecode.com/tutorials/javascript-tutorial-the-scroll-wheel
    If you read this article the code below should make sense.
    From this article i used the hookEvent and cancelEvent
    functions. In my particular case I embed the SWF object inside a
    JSP page using some javascript code. After the SWF is loaded i
    added the following line of code:
    hookEvent('my_swf_id', 'mousewheel', handleMouseWheel);
    where handleMouseWheel is defined as follows:
    function handleMouseWheel(e)
    if (document.getElementById("my_swf_id"))
    document.getElementById("my_swf_id").focus();
    return cancelEvent(e); // This is the key to the solution...
    When the mouse is over the datagrid in the SWF i can use the
    mouse wheel to scroll its contents without the main browser window
    scrolling at the same time.
    Thanks to all who took time to post their ideas, it was
    appreciated.

Maybe you are looking for

  • How to catch rollback in Disable user process task in Xellerat User Process

    hi ... I want to send an email to manager group of the user, once the user is disabled from the OIM (when end date is reached). I created an adapter and attached it to the 'Changed User Disabled' process task in the 'xellerate user provisioning' proc

  • DR Best Practice

    Hello, We are designing a DR solution using Oracle Data Guard 11gR2. 1- Physical Oracle Data Guard with Primary / Standby database. 2- Use Maximum Availability Mode. 3- Use the Observer for automatic failover. 4- Turn on Flashback databases. 5- Use t

  • I cant accept license agreement!

    I have got a new nano 8GB and when i try and register it so i can use it with the itunes i downloaded, it doesnt allow me to scroll sideways to accept it. I can click to agree, but not to continue. And i have tried ajusting screen resolution! Any ide

  • Prevent from being blocked.

    Hello everyone, When invoking a third party function (which I can not modify its behavior), my application will be blocked when something error occurs and the block dues to the thid party function, which will be blocked when something error occurs. I

  • My phone is getting freezed for some amount of time when i try t unlock the phone

    hey guys do yu have the same problem ?