Allowing Mouse Events to "Fall Through" When Window Activated

I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
Any thoughts, comments, or experiences regarding this are greatly appreciated!

Such a simple solution to such a perplexing problem. You are absolutely right. It turns out I was experience a bug in my particular L&F. Trying this with the Windows L&F proves that simply changing from JWindow to a non-modal JDialog works. Now I'll have to go about getting the bug fixed in the MacOSX (Aqua) L&F so I have equivalent behavior across all our supported platforms.
Thanks for the quick response.

Similar Messages

  • Mouse Events "Falling Through" During Window Activation

    I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
    Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
    I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
    I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
    Any thoughts, comments, or experiences regarding this are greatly appreciated!

    The solution to this problem was posted in the Swing forum. Turns out to be a simple difference of JWindow and JDialog, but a difference I wasn't seeing under all L&Fs (i.e., Windows L&F handles JDialog properly, MacOSX (Aqua) L&F seems to treat it like any other window... I've filed a bug with them).

  • WHEN-WINDOW-ACTIVATED gives focus back to applet window

    Testcase:
    Form A calls form B
    Form B performs this code:
    BEGIN
    web.show_document(url);
    exit_form;
    END;
    This should open a new browser window to the URL and keep the focus on it.
    However, when form A has a WHEN-WINDOW-ACTIVATED trigger (even when the only code is NULL;), it return the focus to the forms applet browser window the first time.
    This is very annoying because the new browser window can no longer be seen as it is put on the background. Strangly enough, the following times the focus remains on the new browser window.
    Is this a known bug?
    PS: The problem is that i really need a WHEN-WINDOW-ACTIVATED trigger in my form A to perform some webutil-functions.
    Environment:
    Forms Developer 10g Release 2
    Application Server 10g Release 2
    Window 2000/Xp
    Oracle Jinitiator 1.3.1.22

    In which trigger are you calling Form B? As I said, the EXIT_FORM event would take you back to Form A after opening the browser window, so what happens next depends on what code it fires once returning to Form A.
    Have you tried it with debug messages on to see what triggers it is firing? (both first time round & subsequently). Logically, I would have actually expected focus to return to Form A following the EXIT_FORM, but maybe I'm wrong ni thinking that.
    Have you experimented with the various WEB.SHOW_DOCUMENT options (e.g. WEB.SHOW_DOCUMENT(url, '_self') to get a different behaviour?

  • When-window-activated trigger not firing

    Hi,
    I got this scenario :
    Opens a form, the When-new-form-instance runs, the When-window-activated runs.
    But if a message is shown in the when-new-form-instance trigger, the when-window-activated wont run.
    Anybody whos got a solution for this, as I need the trigger to run.
    regards
    Kim

    It can be very simple as :
    plib_do_something_1;
    plib_do_something_2;
    message('Show a message on the screen');
    do_key('Enter_query');
    The thing is that its only if the message is showed as pop-up the problem exists. If I remove the 'do_key('enter_query')', the message is showed at the statusbar and the wwa trigger fires.

  • Swing Mouse Event Propagation

    Hello,
    I'm developing my first Swing application.
    One of the components is a thumbnail image panel (ext. JPanel) containing several other components (mostly ext. JLabel). I have the image panel receiving mouse events so as to allow the user to see when the image panel is 'in focus' (rollover effect basically) and to allow the image panel to be selected by clicking.
    I added a tooltip to one of the contained labels, and it now 'consumes' my mouse enter/exit event so that now it is as if the label is not part of it's container. This is not what I want.
    Is there not some simple way to allow mouse events to be listened for by a child component but yet to 'fall through' to a listener in the parent component?
    Any insight into this little problem would be most appreciated.
    Thanks.

    You can listen to all MouseEvents generated:
    Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
         public void eventDispatched(AWTEvent e)
              System.out.println(e);
    }, AWTEvent.MOUSE_MOTION_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK);You would then need to determine if the source component is a descendent of your main panel.

  • Set Form To Query Mode When Particular Window Activated

    I have a form with multiple windows. I have one window that when activated I want the form to be in query mode. This window functions as a more user-friendly search method. So when the user enters the window it will be in query mode, they will be able to enter data into a field, and then click a button I've created to execute the query and return results. I know I can use the when_window_activated built in, but I am not sure of the proper trigger code to accomplish what I've described below. I am also not sure of what level to place such a trigger. Any help is greatly appreciated. Thanks, Jason.

    You are correct, the when-window-activated trigger will only work at the form level.
    Your suggestion would work if the window in question was the initial window activated at form start up. However it is not the startup window. I am calling this window via a button from the startup window. When the button is activated I close my startup window (which is basically a menu window that takes the user to other windows based on the button they selected) and activate the window associated with the selected button.
    So including the form level when-window-activated trigger as suggested causes both my selected startup window (set in the form properties) and the window I wish to be in query mode to launch...and I receive a FRM-41009: Function key not allowed error.
    Regards,
    Jason

  • PJC window activated

    In one of our webforms, we have a link with Excel. When we choose the option in the popup menu, the focus is given to an Excel document, where we change one of the values of the record. When the focus is given back to the form (eg: closing the excel file), we would like the records to be requeried.
    We've already achieved this by adding a bean area to the form, which executes the code of when-window-activated trigger. The java code for this pjc checks for an object of the class JBufferedFrame. This worked for a while, but now we can't find an object of that class in the hierarchy anymore.
    some questions:
    - Has JBufferedFrame been renamed or replaced?
    - Is there another way to handle this issue?
    Code snippet:
    Container container = this.getParent();
    while (container!=null)
    // output the object hierarchy
    System.out.println("----> "+container.getName()+" ["+container.getClass()+"] [" + container.getClass().getName() + "]") ;
    if (container.getClass().getName().equals("oracle.ewt.swing.JBufferedFrame"))
    System.out.println("stuffing JBufferedFrame");
    buframe = (JBufferedFrame) container;
    formsWindowAdapter = new FormsWindowAdapter();
    buframe.addWindowListener(formsWindowAdapter);
    The hierarchy printed by these statements:
    ----> DrawnPanel0 [class oracle.forms.ui.DrawnPanel] [oracle.forms.ui.DrawnPanel]
    ----> ScrollBox$11 [class oracle.ewt.scrolling.scrollBox.ScrollBox$1] [oracle.ewt.scrolling.scrollBox.ScrollBox$1]
    ----> FScrollBox2 [class oracle.forms.ui.FScrollBox] [oracle.forms.ui.FScrollBox]
    ----> TabPanelSheet3 [class oracle.ewt.tabPanel.TabPanelSheet] [oracle.ewt.tabPanel.TabPanelSheet]
    ----> FormsTabPanel0 [class oracle.forms.ui.FormsTabPanel] [oracle.forms.ui.FormsTabPanel]
    ----> DrawnPanel4 [class oracle.forms.ui.DrawnPanel] [oracle.forms.ui.DrawnPanel]
    ----> ScrollBox$15 [class oracle.ewt.scrolling.scrollBox.ScrollBox$1] [oracle.ewt.scrolling.scrollBox.ScrollBox$1]
    ----> FScrollBox6 [class oracle.forms.ui.FScrollBox] [oracle.forms.ui.FScrollBox]
    ----> EwtComponent7 [class oracle.ewt.EwtComponent] [oracle.ewt.EwtComponent]
    ----> LWComponent8 [class oracle.ewt.lwAWT.LWComponent] [oracle.ewt.lwAWT.LWComponent]
    ----> ExtendedFrame9 [class oracle.forms.ui.ExtendedFrame] [oracle.forms.ui.ExtendedFrame]
    ----> FormDesktopContainer10 [class oracle.forms.ui.FormDesktopContainer] [oracle.forms.ui.FormDesktopContainer]
    ----> ScrollBox$111 [class oracle.ewt.scrolling.scrollBox.ScrollBox$1] [oracle.ewt.scrolling.scrollBox.ScrollBox$1]
    ----> ScrollBox12 [class oracle.ewt.scrolling.scrollBox.ScrollBox] [oracle.ewt.scrolling.scrollBox.ScrollBox]
    ----> EwtComponent13 [class oracle.ewt.EwtComponent] [oracle.ewt.EwtComponent]
    ----> MDIContainer14 [class oracle.forms.ui.mdi.MDIContainer] [oracle.forms.ui.mdi.MDIContainer]
    ----> Main0 [class oracle.forms.engine.Main] [oracle.forms.engine.Main]
    ----> frame0 [class sun.plugin2.main.client.PluginEmbeddedFrame] [sun.plugin2.main.client.PluginEmbeddedFrame]

    Hey,
    The purpose of this solution was to catch the event when a user returns from an Excel document, so we could requery the form. The solution described Works for this issue. But when testing this solution, another strange issue happens.
    Situation:
    We have two forms10g windows open (mdi windows). In one of them we open a form with the java bean that implements the solution as described earlier. When we go to the Block where SetProperty is issued, a window listener is being attached. When we open a second form, no matter which form it is, navigation to another java session is not possible. So the user can’t navigate to the second mdi window.
    There are no problems as long as we don’t attach the window listener (by issuing set_custom_item_property). Is the window listener being attached to a wrong frame (PluginEmbeddedFrame)? Or what could cause this behaviour? (eg does dispatchCustomEvent causes the focus to remain in one window(=java session)?

  • WINDOW-RESIZED and WINDOW-ACTIVATED

    The WHEN-WINDOW-RESIZED and WHEN-WINDOW-ACTIVATED
    triggers seem to be conflicting - when both of them
    should fire (focus is on one window but go on to
    resize another one), the WHEN-WINDOW-RESIZED trigger
    doesn't fire.
    Any solution or tricky workaround? Thanks in advance.

    Please, anyone?

  • On my own website vdha.us, I am now getting many words that are purple and when you mouse over them, a new spamming window opens trying to sell something. IE-9 does not do this. How do I turn this off in firefox?

    Sirs,
    The below URL came up immediately when I tried to access our Newfangled website this morning http://vdha.us :
    http://surveyprizecenter.com/survey/claimgift-GT-kw-7b.php?t202kw=Vdha.us&trimmedKeyword=Vdha.us
    I prefer to use Firefox and very seldom use IE-9. but now I might be forced to remove Firefox 4.0.1 and resort to using IE-9 because of this situation.
    I don’t know how spammers can use our website to exploit their spamming, but I can only imagine the complaints I am going to get from our Board of Directors and members about this.
    Can you make them stop, or at least explain how it is that anyone can do this without our permission.
    We have never allowed advertisement on our website and don’t plan on starting now.
    I am now also getting many words that are purple with two lines under them, and when you mouse over them, a new spamming window opens automatically trying to sell something. How do I turn this off?
    I would appreciate any expediency in the return of an answer that you can provide.
    Kindest Regards,
    Dave Broeker
    VDHA Life Member #1797
    VDHA Webmaster & BX Manager
    http://vdha.us

    The "MySearchDial" app needs to be removed in 4 places.
    1) Go to "add / remove programs" in your windows control panel select mysearchdial and remove it.
    2) Open your Firefox browser then click the Firefox tab at the top left and select options. You will need to change the start page settings back to your preferred start page.
    3) Again under the Firefox tab select "add-ons". In the add-ons manager you will need to remove mysearchdial from both "plugins" and "extensions"
    4) In your search bar (top right of address bar" use the drop down menu and select "manage search engines". You can restore your preferred search engine and remove mysearchdial from the menu.
    This should remove all the components of the nuisance hijacker and restore your browser back to your preferred settings. If you are comfortable with a more in depth removal I would also suggest going to your "programs" folder within the "C" drive of your machine and deleting the "MySearchDial" folder altogether. However, only do this AFTER you have uninstalled it from your system and if you are familiar with this type of removal.

  • Mouse events directed to one window in Xorg 1.7.x

    Hi there,
    There has been much talk about Xorg 1.7.x, and this one is another tale [Searched the forum 1st and googled but did not find a similar problem, so if mistaken, sorry ] I have and Dell XPS m1210 and using KDE4 (KDEMod) on Arch64. On xorg 1.7.x (all the version from the repos) after a while the mouse begins to behave strangely: I can not select any window with the mouse or touchpad it keeps sending the events (clicks for instance) to the active window. (even if I click out of the window)! And when change the window using alt+tab, the same thing happens but for the new active window.
    This is my Xorg.conf. I use hotplugging:
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    EndSection
    Section "Files"
    EndSection
    Section "Module"
    Load "dbe"
    Load "extmod"
    Load "glx"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection

    AndyRTR wrote:When you want to use packages from testing repo you need to -Syu ALL packages. There are also new keyboard and evdev drivers and more. You should read around how to deal with upgrading Arch and how to use the testing repo. It's not recommended and expected to work when you only pick a few packages.
    Ok. System upgraded from testing repo. Keyboard and mouse are works. But strange area on screen is still there. It's a strange framebuffer or smth same I think.
    Here is screenshot: http://img340.imageshack.us/img340/306/ … 4x600s.png
    Area with "OPENBOX" text is it. There are no "EE" in Xorg.0.log
    Last edited by darklion (2009-10-29 11:17:27)

  • When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....

    When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....
    Could some one give help and let me know where I can probably find the settings option that allows me to change and switch to previous situation where it was possible to decide time to time how to proceed either opening the file or saving it ??
    Thanks in advance
    David

    What is your operating system?
    Open a PDF from where?  If online, in what browser?

  • TS1398 I set up my ipad through my windows XP PC, now when i try to access itunes on my Ipad 3, i get an error saying 'Cannot Connect to itunes'

    I set up my ipad through my windows XP PC, now when i try to access itunes on my Ipad 3, i get an error saying 'Cannot Connect to itunes'

    Try this:
    Go to Settings>General>Date & Time and change the date to a few months in the future and then re-try.

  • Bing Maps on IE 11 browser, The mouse click event is only working when we have compatibility mode on.

    I have tried out the code in this article in ASP.Net web forms with c#  and javascript.
    I am using Ajax to call the C# from Javascript and load the data from database.
    I have used following article to show the pushpins and there infoboxes.
    http://blogs.msdn.com/b/rbrundritt/archive/2013/11/08/multiple-pushpins-and-infoboxes-in-bing-maps-v7.aspx?CommentPosted=true#commentmessage
    My code works great on IE 11 , when I have compatibility mode on,
    but when compatibility mode is off, the mouse click event is not being received by the Javascript function.
    Is this expected behavior of bing maps, Are there any workarounds for this problem?
    Thanks
    Nate

    Hi Ricky, I have tried using Chrome and I see the same issue. The mouse events are not being captured. 
    Here is my code
    <%@ Page Title="" Language="C#" MasterPageFile="~/Maps.Master" AutoEventWireup="true" CodeBehind="BingMaps.aspx.cs" Inherits="MyMaps.secure.BingMaps" %>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderBody" runat="server" >
    <asp:ScriptManager ID="ScriptManager" runat="server"
    EnablePageMethods="true" />
    <div id="MapHolder" style="; width:1000px; height:800px; " />
    <asp:Literal ID="Literal1" runat="server">
    </asp:Literal>
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="ScriptSection" runat="server">
    <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0">
    </script>
    <script type="text/javascript" >
    var map = null, infobox, dataLayer;
    $(document).ready(function () {
    GetMap();
    function GetMap() {
    // Initialize the map
    map = new Microsoft.Maps.Map(document.getElementById("MapHolder"),
    { credentials: "lincensekey", zoom: 2 });
    dataLayer = new Microsoft.Maps.EntityCollection();
    map.entities.push(dataLayer);
    var infoboxLayer = new Microsoft.Maps.EntityCollection();
    map.entities.push(infoboxLayer);
    infobox = new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0, 0), { visible: false, offset: new Microsoft.Maps.Point(0, 20) });
    infoboxLayer.push(infobox);
    PageMethods.GetLocations(RequestCompletedCallback, RequestFailedCallback);
    function AddData(MapPoints) {
    for (var i = 0, len = MapPoints.length; i < len; ++i)
    var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(parseFloat(MapPoints[i].lat),parseFloat(MapPoints[i].lon))
    icon: MapPoints[i].group,
    height: 50, width: 60, text: MapPoints[i].city
    pushpin.Title = MapPoints[i].name;
    pushpin.description = MapPoints[i].desc;
    Microsoft.Maps.Events.addHandler(pushpin, 'click', displayInfobox);
    dataLayer.push(pushpin);
    function displayInfobox(e) {
    if (e.targetType == 'pushpin') {
    infobox.setLocation(e.target.getLocation());
    infobox.setOptions({ visible: true, title: e.target.Title, description: e.target.description });
    function RequestCompletedCallback(result) {
    result = eval(result);
    AddData(result);
    function RequestFailedCallback(error) {
    var stackTrace = error.get_stackTrace();
    var message = error.get_message();
    var statusCode = error.get_statusCode();
    var exceptionType = error.get_exceptionType();
    var timedout = error.get_timedOut();
    alert("Stack Trace: " + stackTrace + "<br/>" +
    "Service Error: " + message + "<br/>" +
    "Status Code: " + statusCode + "<br/>" +
    "Exception Type: " + exceptionType + "<br/>" +
    "Timedout: " + timedout);

  • HT1595 I have just bought apple tv which allows me to play music through airport express but when  chose to watch a movie the audio comes from the tv and does not give option listen through other speakers served through airport express. Can you help me ?

    I have just bought apple tv which allows me to play music through airport express but when  chose to watch a movie the audio comes from the tv and does not give option listen through other speakers served through airport express. Can you help me ?

    No, you cannot seperate the audio and video stream.
    You can use optical audio to a sound system (I use sony sound bar) and play the audio via that.
    jules

  • How to deal with the mouse events when the thread is running

    Hi everybody,
    I have a problem with my program.
    Now I want to present a picture for some time in the Canvas,then automatically clear the screen, but when the user press the mousebutton or keybutton, I want to stop the thread and clear the screen.
    How can I receive the mouse event when the thread is running?
    Thanks,

    I use my code in a GUI applet.
    I try to use the code tag, it's the first time.
                   Image im=sd.getStimulus(obj);
                   if(pos==null){
                        g.drawImage(im, (w-im.getWidth(null))/2,(h-im.getHeight(null))/2,null);
                   }else{
                        g.drawImage(im, pos.x,pos.y,pos.w,pos.h,null);
                   try{
                        sleep(showtime);
    //                    Thread.sleep(showtime);
                   }catch(InterruptedException e){}
                   if(pos==null){
                        g.clearRect((w-im.getWidth(null))/2,(h-im.getHeight(null))/2,im.getWidth(null),im.getHeight(null));
                   }else{
                        g.clearRect(pos.x,pos.y, pos.w, pos.h);
                   }

Maybe you are looking for

  • MacBook Pro Specs

    I am considering purchasing a MacBook Pro though I had a few questions and where else to ask but here. I hope to find the answers. 1. Dual booting my MacBook pro with XP, will I still be able to play all my Windows based games as if set up on a PC. 2

  • Apple Server 4.0.3

    I am a newbie here working with Apple server. I am in the file sharing area and working on propagating. My server has recently been updated to the Version 4.0.3 with a Yosemite OS and my computer clients are Mavericks OS (except for 2 that are the Yo

  • EMail Address & Password Problem

    I have about six EMail addresses and I have set each up as a seperate account on my N9 and, mostly, it works fine. I have two iCoud addresses; one works and the other fails everytime - it generates an error message that "either the username or passwo

  • Python tool for keeping track of strings

    I wrote this just now. It associates keys to strings; basically a centralized means of storing values. #!/usr/bin/env python from cPickle import load, dump from sys import argv from os.path import expanduser strings_file = expanduser('~/lib/cfg-strin

  • ITunes 7.0.2.16 Issues

    Tring to install iTunes - not anything new - replaced HD and loaded up from scratch - have done this many times never had an issue w/ iTunes - anywho - downloaded - installed - tried to open and comes up with error to send to microsoft - doesn't even