How to consume an event in windowClosing()

Hi,
I need to consume the window event once it has been serviced.
class SymWindow extends java.awt.event.WindowAdapter
public void windowClosing(WindowEvent event)
// blah blah
My_WindowClosing(event);
My_WindowClosing(event) in turn pops up a JOptionDialog with YES, NO, CANCEL options. For YES, I can close this GUI by calling dispose(). But for NO, this windowClosing() gets called again, instead of closing this JOptionDialog. Also Close(x) for this JOptionDialog doesnt work ( windowClosing() gets called recursively again)
My issue is that windowClosing() is being called recursively.
So, what I want is that once this event has been serviced ( My_WindowClosing(event);), this windowClosing() should not be called again.
Any suggestions please.
Regards,
Ashish

Ashish, this forum is for Java-Collections,
please post your question in appropriate places like AWT.

Similar Messages

  • How to consume key events

    I would like to create a subclass of TextBox that only allows numeric input. My idea was to provide my own onKeyType() handler and consume any key events that do not correspond to digits. However, I can't find any way to consume key events from further processing. How do I do this?
    Are there any other suggestions how to accomplish the task of providing your own filter concerning valid key input?
    /Bengt

    I also wanted a kind of validators for the TextBox class of JavaFX. So I've tried solving the problem using the SwingTextField class and some Java APIs. The following is my code for a SwingTextField accepting only digits, but I do want it to be much simpler.
    import java.awt.AWTEvent;
    import java.awt.event.AWTEventListener;
    import java.awt.event.KeyEvent;
    import java.awt.Toolkit;
    import javafx.ext.swing.SwingTextField;
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    import javax.swing.JComponent;
    class DigitKeyEventHookListener extends AWTEventListener {
        public-init var  source:JComponent;
        public  override function  eventDispatched( event:AWTEvent):Void {
            if (event.getSource().equals(source)) {
                var keyEvent : KeyEvent = event as KeyEvent;
                var keyCharacter = keyEvent.getKeyChar();
                var isDigit = false;
                var code = keyEvent.getKeyCode();
               if ((KeyEvent.VK_0 <= keyCharacter) and (keyCharacter <= KeyEvent.VK_9)) {
                       isDigit = true;
                if ((code ==KeyEvent.VK_DELETE) or (code ==KeyEvent.VK_BACK_SPACE)) {
                    isDigit = true;
                if ((code ==KeyEvent.VK_LEFT) or (code ==KeyEvent.VK_RIGHT)) {
                    isDigit = true;
               if (not isDigit) {
                    keyEvent.consume();
    function createSwingTextField() : SwingTextField{
        var field = SwingTextField {
            columns:12
        var listener =  DigitKeyEventHookListener{
            source: field.getJTextField()
        Toolkit.getDefaultToolkit().addAWTEventListener(listener, AWTEvent.KEY_EVENT_MASK);
        return field;
    Stage {
        title: "Digit Box"
        width: 200
        height: 80
        scene: Scene {
            content: createSwingTextField()
    }

  • How to consume ETW events data in C#

    Hi,
    I am using Microsoft.BizTalk.CAT.BestPractices.Framework for tracing data in Custom Pipeline Components, Maps and Orchestrations.
    I want to capture events data in Real-time by using C# code.
    Can someone help how can i capture events data in c#?
    Thanks,
    Shahzad

    Hi Shahzad,
    When you use the Microsoft BizTalk CAT Teams logging framework for instrumenting your BizTalk solution then
    it will write events to the Windows ETW sub system. You need to write a component,lets call it as a monitor that will capture these events and write to database. There is an excellent project in codeplex titled 'Testing inside BizTalk using ETW Tracing'.See
    here .
    It is basically a console app that detect events published to ETW by the BizTalk logging framework and then
    publish them onto an MSMQ queue .See the source code for this project and you can implement the same in your C# component.
    Regards,
    Sajith C P Nair
    Please mark as answer if this helps

  • Can SOA consume business events using non-apps datasource ?

    Hi Gurus & Experts,
    We have a scenario where EBS raises custom business event to be consumed by SOA.
    Everything works fine using APPS login, however we need to non-apps datasource in some environements (custom schema user)
    Can SOA consume business events using non-apps datasource ?
    Please let me know.
    Thanks,
    Rev

    Hi Srini,
    Even i have a similar requirement . Could you please send me the link for OracleEBSAdapterUserGuide(b_28351). ?
    Did you come to know how to check whether WF_Listener is running ?
    Thanks in advance
    Nutan

  • Producer Consumer & User Events with user input windows

    Hello All,
    I am planning to build Labview code using the Producer Consumer & User events pattern, the application needs multiple user input windows for things like personal data, feature selection etc, there could be around 15 or 20 distincts screen/panels required.
    The main question from me is... Is there a best practive approach to navigating/loading from one window to another etc, and also providing a way to to retrun to the previous window.
    Also I may need need to be running some slow logging and control hardware in the background while navigating some of the screens, this seems like the producer consumer vi will be running in the background while the user input causes a load/display window event.
    A simple Producer Consumer multiple winjdoow example would be very welcome. Thanks.
    Regards Chris

    I will second Mike's suggestion to use a central VI with subpanel(s).  It is usually less confusing than multiple windows.  Typically, the selection/navigation mechanism is on the left of the main panel, global info (like help) on the right, and the subpanel(s) in the center.
    The advantage of subpanels/subVIs is that you can launch your subVIs and keep them active in the background, even though they are not being used.  This means they will keep their state information and load into the subpanel almost instantaneously the next time you need them.  For a short tutorial on subpanels, check out this link.  Scroll down to the fourth reply for working code.  The original code posted is broken.
    Communication between your VIs or loops is typically done with either queues or event structures.  State information in each should be shift registers in the respective VIs.  If you have the time, I would highly recommend you learn how to use LabVIEW classes.  The command pattern is tailor made for this kind of application.
    Finally, avoid global data if you can.  Global data is anything that you can get to from anywhere (globals, functional globals, etc.).  Use of these can speed your development, but can also lead to sloppy design which will cause you major problems later.  If you really need globally available data, use a data value reference.  It is unnamed and requires a reference, which tends to enforce better programming practice.  Yes, there are instances where you truly need globally available, named data, but they are fairly rare.  You should only use them if you are experienced and really know what you are doing.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to Consume ChangeEvent

    Hi All,
    I wanted to consume the change event.
    For example: consume in InputEvent
    public void consume()
    Consumes this event so that it will not be processed in the default manner by the source which originated it.
    Overrides:
    consume in class AWTEvent
    Please suggest me the way, how to do the same thing incase of ChangeEvent
    Thanks in advance....

    You can't.
    If your state your use-case level requirement, there should be a standard way for that.

  • How to Consume WSDL FROM PeopleSoft to SAP

    How to Consume WSDL FROM PeopleSoft to SAP
    Points will be rewarded
    thank you,
    Regards,
    Jagrut BharatKumar Shukla,

    HI
    Please refer to the following links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d5d4a6e3-0601-0010-6aa9-ac3a1f747ea5
    http://www.mindtelligent.com/pdf/details.ppt
    http://www.bea.com/content/news_events/white_papers/BEA_WL_Adapters_ds.pdf
    http://www.oracle.com/technology/products/applications/Events/OOW-2005/S3534_Doron_Avizov.pdf
    http://download.microsoft.com/download/8/9/5/89585721-4774-4b5e-856b-c9db5d2980b3/Application%20Integration%20Fact%20Sheet.pdf
    Regards
    Ravish Garg
    <i>
    Reward if useful</i>

  • How to consume a web service provided by third party system from SAP system

    Hi Friends,
    Could any of you provide me a clear picture on how to consume a web service from SAP system and is provided by a third party system?
    Do we get an URL to create a client proxy for consuming the web service?
    Thanx in advance,
    Ram

    Hi Ram,
    of course you cannot supply the WSDL URL. Inside the WSDL (just view it in your browser) you find (usually but not necessary) towards the end something like
    <soap:address location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"/>
    which is the actual adress of the service.
    An example service can be found here:
    <a href="http://www.weather.gov/xml/">National Digital Forecast Database</a>
    containing the WSDL URL at
    <a href="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl">this address</a>.
    You might also want to browse for the amazon webservices which allow you to embed queries against amazon into your application.
    have fun,
    anton

  • How to cancel the event in Item Adding and display javascript message and prevent the page from redirecting to the SharePoint Error Page?

    How to cancel the event in Item Adding without going to the SharePoint Error Page?
    Prevent duplicate item in a SharePoint List
    The following Event Handler code will prevent users from creating duplicate value in "Title" field.
    ItemAdding Event Handler
    public override void ItemAdding(SPItemEventProperties properties)
    base.ItemAdding(properties);
    if (properties.ListTitle.Equals("My List"))
    try
    using(SPSite thisSite = new SPSite(properties.WebUrl))
    SPWeb thisWeb = thisSite.OpenWeb();
    SPList list = thisWeb.Lists[properties.ListId];
    SPQuery query = new SPQuery();
    query.Query = @"<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + properties.AfterProperties["Title"] + "</Value></Eq></Where>";
    SPListItemCollection listItem = list.GetItems(query);
    if (listItem.Count > 0)
    properties.Cancel = true;
    properties.ErrorMessage = "Item with this Name already exists. Please create a unique Name.";
    catch (Exception ex)
    PortalLog.LogString("Error occured in event ItemAdding(SPItemEventProperties properties)() @ AAA.BBB.PreventDuplicateItem class. Exception Message:" + ex.Message.ToString());
    throw new SPException("An error occured while processing the My List Feature. Please contact your Portal Administrator");
    Feature.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Feature Id="1c2100ca-bad5-41f5-9707-7bf4edc08383"
    Title="Prevents Duplicate Item"
    Description="Prevents duplicate Name in the "My List" List"
    Version="12.0.0.0"
    Hidden="FALSE"
    Scope="Web"
    DefaultResourceFile="core"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
    <ElementManifest Location="elements.xml"/>
    </ElementManifests>
    </Feature>
    Element.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Receivers ListTemplateId="100">
    <Receiver>
    <Name>AddingEventHandler</Name>
    <Type>ItemAdding</Type>
    <SequenceNumber>10000</SequenceNumber>
    <Assembly>AAA.BBB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8003cf0cbff32406</Assembly>
    <Class>AAA.BBB.PreventDuplicateItem</Class>
    <Data></Data>
    <Filter></Filter>
    </Receiver>
    </Receivers>
    </Elements>
    Below link explains adding the list events.
    http://www.dotnetspark.com/kb/1369-step-by-step-guide-to-list-events-handling.aspx
    Reference link:
    http://msdn.microsoft.com/en-us/library/ms437502(v=office.12).aspx
    http://msdn.microsoft.com/en-us/library/ff713710(v=office.12).aspx
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

    Recommended way for binding the list event handler to the list instance is through feature receivers.
    You need to create a feature file like the below sample
    <?xmlversion="1.0"encoding="utf-8"?>
    <Feature xmlns="http://schemas.microsoft.com/sharepoint/"
    Id="{20FF80BB-83D9-41bc-8FFA-E589067AF783}"
    Title="Installs MyFeatureReceiver"
    Description="Installs MyFeatureReceiver" Hidden="False" Version="1.0.0.0" Scope="Site"
    ReceiverClass="ClassLibrary1.MyFeatureReceiver"
    ReceiverAssembly="ClassLibrary1, Version=1.0.0.0, Culture=neutral,
    PublicKeyToken=6c5894e55cb0f391">
    </Feature>For registering/binding the list event handler to the list instance, use the below sample codeusing System;
    using Microsoft.SharePoint;
    namespace ClassLibrary1
        public class MyFeatureReceiver: SPFeatureReceiver
            public override void FeatureActivated(SPFeatureReceiverProperties properties)
                SPSite siteCollection = properties.Feature.Parent as SPSite;
                SPWeb site = siteCollection.AllWebs["Docs"];
                SPList list = site.Lists["MyList"];
                SPEventReceiverDefinition rd = list.EventReceivers.Add();
                rd.Name = "My Event Receiver";
                rd.Class = "ClassLibrary1.MyListEventReceiver1";
                rd.Assembly = "ClassLibrary1, Version=1.0.0.0, Culture=neutral,
                    PublicKeyToken=6c5894e55cb0f391";
                rd.Data = "My Event Receiver data";
                rd.Type = SPEventReceiverType.FieldAdding;
                rd.Update();
            public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
                SPSite sitecollection = properties.Feature.Parent as SPSite;
                SPWeb site = sitecollection.AllWebs["Docs"];
                SPList list = site.Lists["MyList"];
                foreach (SPEventReceiverDefinition rd in list.EventReceivers)
                    if (rd.Name == "My Event Receiver")
                        rd.Delete();
            public override void FeatureInstalled(SPFeatureReceiverProperties properties)
            public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
    }Reference link: http://msdn.microsoft.com/en-us/library/ff713710(v=office.12).aspxOther ways of registering the list event handlers to the List instance are through code, stsadm commands and content types.
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

  • How to create the event in the report for jobs scheduling.

    Hi Experts,
    i have a requirement like as follows:
    The following triggers for Batch Jobs in the SCM system will be created.i.     
    Background Processing Event = u201CAPO Background Processing Eventu201D. After sending the Event, write a Log Report line u201CEvent u201CAPO Background Processing Eventu201D sentu201D.
    Could you please suggest me how we create the Event or which transaction ?
    Please give me a steps for creating events so that based on these events we use
    CALL METHOD cl_batch_event=>raise
        EXPORTING
          i_eventid                      = p_bpeve
          i_server                       = p_server
          i_ignore_incorrect_server      = p_ignore
        EXCEPTIONS
          excpt_raise_failed             = 1
          excpt_server_accepts_no_events = 2
          excpt_raise_forbidden          = 3
          excpt_unknown_event            = 4
          excpt_no_authority             = 5
          OTHERS                         = 6.
    Right now i received message "APO Background Processing Event" is doesn't exists.
    Thanks in Advance.
    Puneet.

    Hi Puneet,
    Goto transaction SM62 and in there to BckProcEvents tab. There you can create the events.
    You just need to specify the name and Description of an event.
    Hope this serves your purpose.
    Thanks

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • How can I remove events from my iPhone. I want to delete all the events from my iPhone.

    how can I remove Events from my Photo in iPhone

    Connect to computer iTunes and uncheck under Photos > Events then do a sync.

  • How to get resume event in app?

    How to get resume event in app?

    Hi,
    Have a look at this
    Windows Phone Application Lifecycle
    I think you are looking about Application_Activated which is explained in detail in the above article.
    Pradeep AJ

  • I just installed Yosemite.  Notifications Center will not show ICal entries that were on my ICal at time of installation.  How do I get events to show in Notification Center?

    I just installed Yosemite.  Notifications Center will not show ICal entries that were on my ICal at time of installation.  How do I get events to show in Notification Center?

    Submit your feedback requesting this feature directly to Apple using the appropriate link on the Feedback page:
    http://www.apple.com/feedback

  • Help appending how many times an event ID has occurred next to the unique Event ID.

    Hello,
    I am trying to figure out how to find how many times an event occurred and then append that next to the single  -unique Event ID.
    The closest I can find is the Sort-Object Count but I can't figure out how to get that work within the below script.
    Any help would be appreciated, the below script works already. but just doesn't have that Event ID count. 
    Thank you for any help. 
    Below is the
    script to pull all Event Logs for each server, filter them to only display Warnings, Failures, and FailureAudits for Application, System, and Security logs and then remove all duplicate EventIDs so only 1 of each is shown. it then exports that info into a
    .CSV per server.
    param([string]$days= "31" )
    $servers = @("Server1", "Server2" "Server3", "Etc")
    $user = Get-Credential
    #Set namespace and calculate the date to start from
    $namespace = "root\CIMV2"
    $BeginDate=[System.Management.ManagementDateTimeConverter]::ToDMTFDateTime((get-date).AddDays(-$days))
    $store = "C:\Powershell\MonthlyMaintenance"
    foreach ($computer in $servers)
    $filter="TimeWritten >= '$BeginDate' AND (type='Warning' OR type='Error' OR type='FailureAudit')"
    Echo "Pulling Event Logs for $computer ..."
    Get-WmiObject Win32_NTLogEvent -computername $computer -Filter $filter |
    sort eventcode -unique |
    select Computername,
    Logfile,
    Type,
    @{N='TimeWritten';E={$_.ConvertToDateTime($_.TimeWritten)}},
    SourceName,
    Message,
    Category,
    EventCode,
    User |
    Export-CSV C:\Powershell\MonthlyMaintenance\$computer-Filter.csv
    Echo "Done."

    Unfortunately adding that to the script just outputs a bunch of jargon:
    #TYPE Microsoft.PowerShell.Commands.Internal.Format.FormatStartData
    ClassId2e4f51ef21dd47e99d3c952918aff9cd
    pageHeaderEntry
    pageFooterEntry
    autosizeInfo
    shapeInfo
    033ecb2bc07a4d43b5ef94ed5a35d280
    Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo
    Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo
    9e210fe47d09416682b841769c78b8a3
    I did try adding it in various ways and removing the initial # Sort EventCode -unique | # and I just get the same jargon
    Am I adding it in wrong some how? 
    Thank you again for any help.
    param([string]$days= "31" )
    $servers = @("ComputerName")
    $user = Get-Credential
    #Set namespace and calculate the date to start from
    $namespace = "root\CIMV2"
    $BeginDate=[System.Management.ManagementDateTimeConverter]::ToDMTFDateTime((get-date).AddDays(-$days))
    $store = "C:\Powershell\MonthlyMaintenance"
    foreach ($computer in $servers)
    $filter="TimeWritten >= '$BeginDate' AND (type='Warning' OR type='Error' OR type='FailureAudit')"
    Echo "Pulling Event Logs for $computer ..."
    Get-WmiObject Win32_NTLogEvent -computername $computer -Filter $filter |
    sort eventcode -unique |
    select Computername,
    Logfile,
    Type,
    @{N='TimeWritten';E={$_.ConvertToDateTime($_.TimeWritten)}},
    SourceName,
    Message,
    Category,
    User,
    EventCode | Select Name,Count | FT -auto|
    Export-CSV C:\Powershell\MonthlyMaintenance\$computer-Filter.csv
    Echo "Done."

Maybe you are looking for

  • Is there a way to make movies open with the same screen size and position?

    Hello, I'm a new mac guy having just bought an i-mac a few months ago. I have a bunch of saved movies that open in quick time. Each time I open a separate movie by double clicking the file, the window opens in the upper right hand corner in a fairly

  • Debugging in Acrobat 11 (Javascript)

    I am attempting to debug a folder-leel script in Acrobat 11 on the Mac. 1.)  Is there any way to preserve, or to quckly re-enter watches and breakpoints between Acrobat sessions?  According to the docs, for folder-level scripts, such information is n

  • Pages is not compatible on my ipad??

    I started downloading pages for my ipad, the app was slow in downloading than stalled near the completion. I got charged by the app store $9.99 and it doesn't work. when i try to re-instal it it saids pages is not compatible with my ipad...... Now wh

  • Have just got a mini and at first it was texting fine, now have to turn off iMessage to send a text

    Got an iPad mini and at first it was messaging well along with my iPhone , then all at once had to turn off I messaging just to send text!!! Someone please explain

  • Itunes installing error????????????????

    encountered a network error when trying to read from file C:\Windows\Installer\ApplesoftwareUpdate.msi. holy what is this pops up evry time i try to install itunes and then the installer just close. can any one help ?