Invoke a method when Close Window is clicked

Hi,
How do i invoke a method when "close window" on the global button bar is clicked.
Can someone please help.
Thanks in advance.
Pavan
Edited by: user12215240 on Feb 23, 2010 9:32 AM

Is it possible to change the settings so that when the red 'close' button is clicked, the application will hide instead of closing?
Applications don't "close," windows do. If you are just closing windows but not quitting applications that opened them, it is no wonder that there are hundreds of apps in the Dock.
A few apps like System Preferences have only one window, so they automatically quit when you close that one window. Most apps do not do this: even after all their windows are closed, they remain running & thus show up in the Dock, in Activity Monitor, & so on. They each require a little (or sometimes more than a little) real memory reserved for their use to remain running -- this subtracts from what is available to do useful tasks, & will slow down your Mac when it results in too much virtual memory use.
Thus, it is a good idea to quit applications you don't have an immediate need for, especially if they don't require long startup times. If you want easy access to select applications, create a folder & fill it with aliases to those apps, then drag that folder to the right side of the Dock, where it will create a stack. When opened, the stack will allow one click launching of those apps.

Similar Messages

  • Inkove method after close window with unload

    Hi guys,
    I'm trying create a way the invoke a method in a BackingBean after close the window of browser for this I'm using the event unload of 'af:document'.
    I used the Frank's sample ( http://blogs.oracle.com/jdevotnharvest/entry/responding_to_the_page_unload_in_a_managed_bean ) but it doesn't work.
    Can anybody help me?
    I'm using JDeveloper 11.1.2.0.0
    This a part of my code :
    Page
    <f:view afterPhase="#{backingBeanScope.backing_mainPage.afterPhase}"
              beforePhase="#{backingBeanScope.backing_mainPage.beforePhase}">
        <af:document id="d1"
                binding="#{backingBeanScope.backing_mainPage.d1}"
                title="CTBC - Algar Telecom"
                smallIconSource="imgs/favicon.png imgs/favicon.ico"
                onunload="performUnloadEvent"
                clientComponent="true">
        <af:resource type="javascript">
                window.addEventListener('beforeunload', function (){performUnloadEvent()},false);
                function performUnloadEvent(){
                  var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
                  var x = AdfCustomEvent.queue(eventSource,
                                               "handleOnUnload", {}, true);
                  var y = 0;
        </af:resource>
        <af:serverListener type="handleOnUnload" method="#{sessaoLogoff.onUnloadHandler}"/>
          <af:form id="f1" binding="#{backingBeanScope.backing_mainPage.f1}">
    .ManageBean
    public class ControlaLogoff {
        public void onUnloadHandler(ClientEvent clientEvent) {
            System.out.println("good bye");
    }Regards,
    Renan

    I just tested the code Frank provided (as is) and it worked for me. the only thing to mention is when I closed browser completely the bean isn't called. If I close the tab running the page all works as expected.
    I strong feeling is that you simply can't catch the event if someone closes the browser (or use task kill). So if that is what you need you are out of luck.
    Again, the other case works for me. So if it's not working for you I guess there is some kind of coding error in your app.
    Timo

  • Close window on click of a button

    Hi all,
    I am developing an application in which there are some checkboxes with a button on the window. When we choose these checkboxes (one or more) and click on the button it opens another window which has some textfields and one button. These textfields are for taking certain parameter to run a process which will be called when the button on second window is clicked.
    Now my problerm is that i want to make the second window closed on click of button on second window. But i m not getting the solution.
    This may be a stupid question but as I m new to this field I really need help.
    Thanks for any response.

    i want to make the second window closed on click of button on second window. But i m not getting the solution.Put following in the button action listener:
    secondWindow.dispose();
    //OR
    secondWindow.setVisible(false);Thanks!

  • Netscape crash when close window with applet

    I am using JDK1.1 and swingall for load JApplets in Netscape without plugin. Sometimes when I close the window where the applet is, netscape crashes.
    I read that could be a problem of memory when the destroy method is called. Can be other reasons, and if it is a problem of memory how can I avoid it ?
    Thanks,

    Try using Netscape v6.0. Earlier versions have already reported having problems with Java Applets. Hope this would help.
    Ashish

  • Finder stops responding. Can't close window or click icons in window bar without moving window.

    When moving files between disks, the Finder stops responding to the close, minimize and expand window (red, yellow, green buttons). If I grab the title bar and move the window, even one pixel, I can click on the boxes. The same is true of the trash button in the window icons.
    It's just annoying.

    I have been plagued by the same problem ever since upgrading to Mavericks.
    I click the red button on windows (various apps), it goes dark but window won't close until I actually make that window active or move it around somewhere.

  • Question on not to close JFrame when close button is clicked

    Hi All,
    Good Morning
    I have frame created like:
    JFrame frame=new JFrame();When we give
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);The above statement closes the frame but i want the same frame to be hidden in the statusbar.So can any one help me in providing any built in method if there or else how to do it??
    Thanks in advance.
    regards,
    Viswanadh

    but i want the same frame to be hidden in the statusbar.Thats what the "minimize" button is for. Don't mix the functionality of the two buttons.

  • Loop rate in main vi slowsdown when subvis window is clicked.

    Hi All,
    I have developed one USB DAQ application with 3 while loops in main vi and 1 subvi with an activex container for video display.
    This video displayer subvi has no function and it has that Activex container to display the video.
    The purpose is to playback acquired signal with the recorded video.
    So I keep both VIs frontpanel opened at all time.
    The speed of the loops in main vi are as follows,
    Loop1: Contains event structure with 250ms timeout terminal.
    Loop2: Contains an while to play the recorded data with the recorded time duration between successive data points.
     may be min of 70 ms delay for each iteration.
    Loop3: Contains another while which run min of 15 ms delay for each iteration.
    The speed problem is as follows,
    When i click on the subvi which contains an activex container, the while loop in Loop2 does not run properly and each iterations delay in millisecond is increasing constantly in terms of  250 milliseconds atleast.
    After releasing mouse button from subvi, the loop agains starts running normally.
    it would be great help for me if somebody can provide a solution for this problem.
    Thanks in advance.
    Thanks,
    Sathish

    I think I know why this happens, I am not sure how te get a workaround.
    The ActiveX interface runs in the  UI thread just like the event structure.
    The event structure forces the whole VI into the UI thread and is only triggered every 250 ms when the ActiveX is claiming all the UI power.
    I think moving the 70 ms. loop into a seperate VI should do.
    (I might be wrong about the above theory)
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How do i end a sub vi when the close window control is clicked?

    Hi,
    I have a sub vi that sits in a while loop until a 'Done' button is pressed but sometimes the user clicks on the close window control in the top left of the window (MacOS) instead.
    After this has happened I would like control to return to the calling vi but it's as though the sub vi is still waiting for someone to click on the done button and the any user actions in the calling vi are ignored.
    How do I wire the close window into my program so as clicking on either it or the Done button will end the sub vi and pass control back to the calling vi?
    Thanks,
    Dave.

    The "event structure" can capture events for "this VI" that include "panel close". If you are using an event structure to look for the push of the Done button, just add another event that will catch the panel close as well (you can even configure the stucture to not pass on the close event). If you are not using the event structure to watch for the done button, perhaps you should. If you cannot use it in the same loop, you can put it in a parallel loop and use any of several signaling mechanisms to communicate between the loops.

  • Method involked when a window is shown and hidden?

    Are there any methods which will be invoked when a window is set visible and invisible (shown and hidden)? WindowAdapter doesn't include such kind of methods.
    I need to do some initialization/cleanup when window is shown/hidden (note: I don't mean Open/Close)
    Give me a hand. Thanks!

    ComponentListener#componentShown & componentHidden ?

  • How can I get a small window to open when a link is clicked (AS2)

    Hi i,m developing a HTML site and used one animated flash button(AS2) I want a small sized window to open when a user clicks on a button.
    The window will contain information that i want to display.It dosnt require a normal 800x600 window to open. I just want a 1/4 size of 800x600 etc. Is this possible and if so how.
    I havnt done this before
    Thanks
    Manoj

    HELLO NED,
    I WAS RECEIVING MANY MAILS FROM YOU, BUT I DON'T UNDERSTAND WHY DOESN'T RELATED WITH MY PETITION, I SEND
    TO YOU AGAIN MY QUESTION, AND IF YOU CAN HELP ME I APPRECIATED VERY MUCH LET ME KNOW.
    THIS IS MY QUESTION....."ABOUT DATAGRID AS3
    Hello Ned, I appreciate very much your soon answer, I believe you have understand me, but how can I do that? could you give some help? This is part of the code and this is the function that I use
    var url: String = "xmls/rests.xml";
    var req:URLRequest = new URLRequest(url);
    var myLoader:URLLoader = new URLLoader();
    myLoader.addEventListener(Event.COMPLETE, completeHandler);
    myLoader.load(req);
    function completHandler(event:Event):void {
           var myLoader:URLLoader = event.currentTarget as URLLoader;
           var xmlDP:XML = new XML (myLoader.data);
           XML.ignoreWhitespace = true;
           dp = new DataProvider(xmlDP);
           dp = sortOn("name", Array.CASEINSENSITIVE);
           dDg.dataProvider = dp;
           aDg.addEventListener(Event.CHANGE, changeHandler);
           function changeHandler(event:Event): void {
                var thisItem:Object = eve.target.selectedItem;
                descripTa.text = thisItem.description;
                aUI.source = (thisItem.image);
                preloader_mc.visible = true;
    My intention is that when a button from a main (swf) loads the swf it displayed the first selected item with a image (UILoader) and the description (TextArea)
    Thanks in advance Ned
    Joselyn             .................."
    THANKS AGAIN NED
    REGARDS
    JOSELYN
    Date: Thu, 13 Oct 2011 07:49:02 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I get a small window to open when a link is clicked (AS2)
    Re: How can I get a small window to open when a link is clicked (AS2) created by Ned Murphy in Flash Pro - General - View the full discussion
    Look at the Methods section and choose whichever suits your needs, the first one listed does not.
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/3969302#3969302
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/3969302#3969302. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Flash Pro - General by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Close dialog window by clicking on 'X'

    Hi
    I am displaying a dialog window that allows the user to modify data.
    When the user clicks on the 'Cancel' button I have placed on the window, the action code fires and the return listener fires.
    I have added some java script that executes the following command when the user closes the dialog by clicking on the close icon.
    submitForm("groupCaptureForm",0,{source:"cancelGroup"});
    Basically simulating a click on the 'Cancel' button.
    For some reason when the user closes the window by clicking on the close icon, the action code fires, but the return listener code never fires.
    Any idea why?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Unix command to click button on dialog box and close windows?

    I administer an elementary school computer lab of 35 eMacs all with OS 10.4.7 and with ARD 3.0. Our network server configuration requires a mounted server on each desktop in order to administer certain software packages we use. Every morning at start-up I have to walk around and manually click "Connect" on the dialog boxes. Then, with this configuration, each time a server is mounted, it opens up a Finder Window on the host machine so I've got to walk around and close windows on all the machines. I'm sure there must be an AppleScript or Unix command that I can set up to do these two tasks but I've not found it (or learned how to write it) in a few days of searching. Any suggestions?
    Thanks,
    Dan

    OK guys,
    I just succeeded in saving the AppleScript command as an application. I put it in the Login Items just after the servers. It worked beautifully! No more open windows exposing sensitive files to the risks of elementary students (how come the mounted volumes always appear on the desktop even when the "hide" button is checked?). It would be great if the mounted volumes were not showing at least in a setting like a school computer lab.
    Now, I'm still dealing with the mounting process requiring me to manually click on "Connect" every time. The Student account doesn't even have a password just to make such things easier. Still the process displays this:
    (Oh well, I guess I can't insert a ScreenShot.)
    Here's what it says: Connect to the file server "server name."
    Connect as: Registered User
    Name: "account name"
    √Remember password in keychain
    (and then two buttons) Cancel or Connect
    That's where I'm at right now. My district Tech. Support folks say that there's no way to avoid the dialog box but John seems to do it OK. They also pointed me to an online source (www.bombich.com) that I haven't yet checked out.
    Thanks again,
    Dan

  • When I launch Firefox 4.0.1 I get an error message that says "We noticed your may have signed inor signed out in another window. Click Ok to reload your page." I have to sign in with my username and password. Richard

    When I launch Firefox 4.0.1 I get an error message that says "We noticed your may have signed inor signed out in another window. Click Ok to reload your page." I deleted Firefox and reloaded it - did not solve the problem. This started occurring after I downloaded Windows Service Pack 2. I have Vista 7 OS. So every time I close and relaunch Firefox, I have to sign in with my username and password. Very very, annoying. If I can't get this corrected, I have to start using another Browser. Thanks for your help. Richard

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/sessionstore.js
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups to get lost, so you will have to create them again (make a note).
    See:
    * http://kb.mozillazine.org/Session_Restore

  • (When I launch Firefox 4.0.1 I get an error message that says "We noticed your may have signed inor signed out in another window. Click Ok to reload your page." Richard)

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [/questions/830592]</blockquote><br>
    (When I launch Firefox 4.0.1 I get an error message that says "We noticed your may have signed inor signed out in another window. Click Ok to reload your page." I deleted Firefox and reloaded it - did not solve the problem. This started occurring after I downloaded Windows Service Pack 2. I have Vista 7 OS. So every time I close and relaunch Firefox, I have to sign in with my username and password. Very very, annoying. If I can't get this corrected, I have to start using another Browser. Thanks for your help. Richard)

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/sessionstore.js
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups to get lost, so you will have to create them again (make a note).
    See:
    * http://kb.mozillazine.org/Session_Restore

  • How to invoke method BEFORE a window event occurs

    Hi all,
    I didn't get may results searching for this.
    I have two windows open - one is a JFrame and the other is an overlay. I would like the overlay to go down BEFORE the windowIconified (window minimized) event. However, the window listener for that event only happens AFTER the window is iconified. Is there any way to do this? In other words, I want to invoke my methods to take down the overlay BEFORE the JFrame is minimized.
    Is there any way this can be done?
    Any help would be greatly appreciated.
    Thanks,
    JB

    The problem is that the windowIconified windowListener occurs AFTER the JFrame has been minimized. Here is the timeline that occurs: User minimizes the window -> windowListener:windowIconified is invoked -> overlay is brought down.
    Here is the timeline that I want:
    User clicks on minimizes -> overlay is brought down -> window is ACTUALLY minimized here

Maybe you are looking for