Handling my own events

What ive got works. Im just curious about my methods compared to what i "should" be doing...
Am using swing, and what I have works a little bit like a forum. So I have a list of sections and entries. When a user clicks a section, the main panel displays entries for that section.
Ive added the main panel as a "SectionListener". When the 'section panel' hears the click, it fires the "SectionChanged" event, which notifies all the "SectionListeners", which i just keep in a java.util.Vector. The "SectionChanged" event just passes the id of the section, the main panel then picks out the entries...
So it works, but am curious how everyone else manages "custom" events?

Yeh, thing is these are just data object, not anything graphical... but i want my graphical components to update when their data is changed.
Ive actually just now re-organised it a bit, ive set up each data object to have its own listeners, where as before i had the gui component had listeners...
Is there anything in the java api that i could extend to include listeners? otherwise ill just make one...

Similar Messages

  • How to handle check box events in alv tree.

    hi,
    i am working in CL_GUI_COLUMN_TREE class.Also using Check box. Now i want to handle events for check box . I am new to ABAP Objects.
    Pls expaline in detail or send code
    thanks in advance,
    senthil kumar.r

    Hello Senthil
    Have a look at the sample report
    SAPCOLUMN_TREE_CONTROL_DEMO
    . The crucial points are:
    <b>(1) Register the required events at the control</b>
    * define the events which will be passed to the backend
      " checkbox change
      event-eventid = CL_GUI_COLUMN_TREE=>EVENTID_checkbox_change.
      event-appl_event = 'X'.
      append event to events.
      CALL METHOD G_TREE->SET_REGISTERED_EVENTS
        EXPORTING
          EVENTS = EVENTS
        EXCEPTIONS
          CNTL_ERROR                = 1
          CNTL_SYSTEM_ERROR         = 2
          ILLEGAL_EVENT_COMBINATION = 3.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
    <b>(2) Set the event handler</b>
    assign event handlers in the application class to each desired event
      SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR g_tree.
    <b>(3) Define and implement event handler method</b>
      METHOD  HANDLE_CHECKBOX_CHANGE.
        " this method handles the checkbox_change event of the tree
        " control instance
        " show the key of the node and the name of the item
        " of the clicked checkbox in a dynpro field
        G_EVENT = 'CHECKBOX_CHANGE'.
        G_NODE_KEY = NODE_KEY.
        G_ITEM_NAME = ITEM_NAME.
        CLEAR  G_HEADER_NAME.
      ENDMETHOD.
    Regards
      Uwe

  • My own EVENTS in java

    is it at all posible in java to create you own event s. and have listeners for them like the one ActionListener has the method actionPerformed(ActionEvent e) can i make my own methods that are triggered by events
    and are only called if a new event is generated. like this method it is only called if the use clickes a button.
    if there is a way could you please tell or show me how.
    many thanks

    Hi,
    "Events" are an application of the observer pattern, usually implemented with the event generator idiom in Java. Please see full example in this detailed article.
    http://www.javaworld.com/javaworld/jw-09-1998/jw-09-techniques.html

  • How to trigger own events?

    How can you create your own events to be triggered?
    For instance, I have an InputStream that I've got through a Socket that's listening for incoming data. I want to signal/trigger an event when data comes in so that the gui (in another class) can take appropriate actions. How can you do this?

    The basic idea is this:
    public interface SockeListener
        void dataEvent(/* pass a parameter if needed.  Often an event interface is added */);
    public class MySocket
         private final List listeners = new ArrayList();
         public void addListener(SocketListener listener)
              listeners.add(listener);
         public void removeListener(SocketListener listener)
              listeners.remove(listener);
         private void triggerEvent()
               for (Iterator i = listeners.iterator(); i.hasNext();)
                    ((SocketListener) i).dataEvent();
    }Check out the PropertyChangeSupport class also.

  • Handling double click event in oops alv

    I need to write a interactive alv where,can any one help me in handling double click event using oops.

    Hello,
    Demo program on interactive ALV using OOPS
    REPORT  ZALV_OOINTERACTIVE.*Class definition for handling double click
    CLASS event_class DEFINITION DEFERRED.*Internal table and work area declarations for dd02l and dd03l
    DATA : it_dd02l TYPE TABLE OF dd02l,
           wa_dd02l TYPE dd02l,
           it_dd03l TYPE TABLE OF dd03l,
           wa_dd03l TYPE dd03l.*data declarations for ALV Main list
    DATA : ty_lay1 TYPE lvc_s_layo,
           it_fieldcat TYPE lvc_t_fcat ,
           ty_fieldcat TYPE lvc_s_fcat ,
           c_alv1 TYPE REF TO cl_gui_alv_grid,
           c_cont1 TYPE REF TO cl_gui_custom_container,
           event_receiver TYPE REF TO event_class.*data declarations for ALV Interactive listDATA : ty_lay2 TYPE lvc_s_layo,
           it_fcat TYPE lvc_t_fcat ,
           ty_fcat TYPE lvc_s_fcat ,
           c_alv2 TYPE REF TO cl_gui_alv_grid,
           c_cont2 TYPE REF TO cl_gui_custom_container.
    **Select options for multiple values and NOT ranges
    SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
    Initialization event
    INITIALIZATION.*Start of selection event
    START-OF-SELECTION.*fetch data into table and field characteristics
      PERFORM fetch_data.*ALV display for output
      PERFORM alv_output.&----
    *&      Form  FETCH_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .*Select the table details
      SELECT * FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l 
    WHERE tabname IN s_table
      AND tabclass = 'TRANSP'.
    ENDFORM.                    " FETCH_DATA----* CLASS lcl_event_receiver DEFINITION----CLASS event_class DEFINITION.*Handling double click
      PUBLIC SECTION.    METHODS:
        handle_double_click
        FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row .ENDCLASS. "lcl_event_receiver DEFINITION
    ----* CLASS lcl_event_receiver IMPLEMENTATION
    ----CLASS event_class IMPLEMENTATION.  METHOD handle_double_click.    DATA : ls_dd02l LIKE LINE OF it_dd02l.*Reading the selected data into a variable
        READ TABLE it_dd02l INDEX e_row-index INTO ls_dd02l.*  *Select the field details of the selected table
        SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
        WHERE tabname EQ ls_dd02l-tabname.
    *calling the ALV containing the field values
        CALL SCREEN 101.  ENDMETHOD. "handle_double_clickENDCLASS. "lcl_event_receiver IMPLEMENTATION&----& Module pbo_100 OUTPUT&----
    *MODULE pbo_100 OUTPUT.
    *set pf-status 'XXX'.
    *set titlebar 'XXX'.
    ENDMODULE. " PBO_100 OUTPUT
    *& Module alv_100 OUTPUT
    &----MODULE alv_100 OUTPUT.*Check if there is no custom container in screen 100
      IF c_cont1 IS INITIAL.*Creating object of container
        CREATE OBJECT c_cont1
         EXPORTING
           container_name = 'CCONT'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*Creating object of alv
        CREATE OBJECT c_alv1
           EXPORTING
            i_parent = c_cont1.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*alv layout
        PERFORM alv_100_layout.*alv field catalogue
        PERFORM alv_100_fieldcat.*Displaying the ALV grid
        CALL METHOD c_alv1->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay1
          CHANGING
            it_outtab       = it_dd02l[]
            it_fieldcatalog = it_fieldcat.    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*Create object of the event class and setting handler for double click
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR c_alv1.  ENDIF.ENDMODULE. " ALV_100 OUTPUT&----& Module pai_100 INPUT&----
    *MODULE pai_100 INPUT.
    ENDMODULE. " pai_100 INPUT----* MODULE PBO_101 OUTPUT----MODULE pbo_101 OUTPUT.
    SET PF-STATUS 'XXX'.
    SET TITLEBAR 'XXX'.
    ENDMODULE. " PBO_101 INPUT----* MODULE ALV_101 OUTPUT----
    MODULE alv_101 OUTPUT.
    *Check if the Custom container exists.
      IF c_cont2 IS INITIAL.*Creating container object
        CREATE OBJECT c_cont2
          EXPORTING
            container_name = 'CDCONT'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*creating ALV grid for interactive list
        CREATE OBJECT c_alv2
          EXPORTING
           i_parent = c_cont2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*ALV layout
        PERFORM alv_101_layout.*ALV fieldcatalogue
        PERFORM alv_101_fieldcat.*Sorting the output by field position
        SORT it_dd03l BY position.*ALV for display field details
        CALL METHOD c_alv2->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay2
          CHANGING
            it_outtab       = it_dd03l[]
            it_fieldcatalog = it_fcat.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.  ENDIF.ENDMODULE. " ALV_101 OUTPUT
    &----& Module PAI_101 INPUT&----
    *MODULE pai_101 INPUT.ENDMODULE. " PAI_101 INPUT
    *&      Form  ALV_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_output .
      CALL SCREEN 100.ENDFORM.                    " ALV_OUTPUT
    *&      Form  ALV_100_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_layout .  ty_lay1-grid_title = 'TABLES'.
      ty_lay1-zebra = 'X'.
      ty_lay1-no_toolbar = 'X'.ENDFORM.                    " ALV_100_LAYOUT
    *&      Form  ALV_100_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_fieldcat .
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'TABNAME'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'TableName'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'TABCLASS'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'CATEGORY'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'AS4USER'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'CREATED'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'AS4DATE'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'DATE'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'AS4TIME'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'TIME'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 6.
      ty_fieldcat-fieldname = 'CONTFLAG'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'Delivery Class'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.ENDFORM.                    " ALV_100_FIELDCAT
    *&      Form  ALV_101_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_layout .  ty_lay2-grid_title = 'FIELDS'.
      ty_lay2-zebra = 'X'.
      ty_lay2-no_toolbar = 'X'.ENDFORM.                    " ALV_101_LAYOUT
    *&      Form  ALV_101_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_fieldcat .  REFRESH it_fieldcat.
      REFRESH it_fcat.
      CLEAR ty_fcat.  ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 1.
      ty_fcat-fieldname = 'FIELDNAME'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'Fieldname'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.
      ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 2.
      ty_fcat-fieldname = 'CHECKTABLE'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'CHECKTABLE'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.  ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 3.
      ty_fcat-fieldname = 'KEYFLAG'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'Key Flag'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.ENDFORM.                    " ALV_101_FIELDCAT

  • No handler for system event CustomHourlyEvent has been registered

    I have written a scheduled event to trigger on daily basis using CustomDaily event mentioned in the ScheduledEvent component. I have referred HowToComponents in order to write this filter. But I am getting following error in my logs and my scheduled event is not getting executed.
    <!-- IDCLOG: Error: (8/23/12 12:01 PM) !csScheduledEventUnhandled,CustomHourlyEvent!$stack trace -->
    <tr><td>Error</td><td>8/23/12 12:01 PM</td><td>No handler for system event CustomHourlyEvent has been registered. stack trace [ <a href="javascript:if(typeof show!='undefined')show('0.31115227955456604')">Details</a> ]
    <div id="0.31115227955456604" style="display:none;" class="details"><pre><code>An error has occurred. The stack trace below shows more information.
    !csScheduledEventUnhandled,CustomHourlyEvent!$stack trace
    !$stack trace
    at intradoc.common.IdcLogWriter.doMessageAppend(IdcLogWriter.java:85)
    at intradoc.common.Log.addMessage(Log.java:279)
    at intradoc.common.DefaultReportHandler.message(DefaultReportHandler.java:508)
    at intradoc.common.DefaultReportDelegator.message(DefaultReportDelegator.java:140)
    at intradoc.common.Report.messageInternal(Report.java:172)
    at intradoc.common.Report.message(Report.java:145)
    at intradoc.common.Report.error(Report.java:408)
    at intradoc.server.ScheduledSystemEvents.processWork(ScheduledSystemEvents.java:600)
    at intradoc.server.ScheduledSystemEvents.run(ScheduledSystemEvents.java:489)
    at java.lang.Thread.run(Thread.java:619)
    </code></pre></div></td></tr>
    Please let me know if anybody has countered the same problem while writing ScheduledEvent filter.

    I was able to solve this issue by updating the state of the event. HowToComponents - ScheduledEvent has the following method:
    * Update the state of the event. Must be done at least once to tell the content server
    * when the scehduled event is finished.
    protected void update(String action, String msg, Workspace workspace) throws ServiceException, DataException
         long curTime = System.currentTimeMillis();
         ScheduledSystemEvents sse = IdcSystemLoader.getOrCreateScheduledSystemEvents(workspace);
         sse.updateEventState(action, msg, curTime);
    Making a call to update() when my scheduled event ran solved the issue for me.

  • Handle doc/open event at folder level

    Hi,
    Is there a way to handle doc/open event at the folder level?

    javax.sing.table.AbstractTableModel.addTableModelListener(TableModelListener l)

  • Handle single click event in ALV OOPS

    Hi,
    I have to display 2 ALV grid...one above the other.
    Top ALV will contain Header info and bottom ALV witll display line item.
    I am use ALV OOPS.
    Now when user will click on the top ALV ...bottom ALV should show corresponding data.
    I don't have to use HOTSPOT or Double click event.
    How can I handle single click event.
    Please guide me..thanks in advance
    Regards,
    Prasoon

    hi,
                    for this in ALV OOPS take <b>2 custom containers( cl_gui_custom_container)</b>in the same screen and on the 1st container display the header data<b>(use set_tale_for_first_display method of class cl_gui_alv_grid)</b>.
                   On the 2nd screen item data for  this  use<b> EVENT</b> handling(you want <b>single click</b>). use<b> hotspot_click</b> or <b>button_click </b>events. 
    for this you have to register the events.   the code for that.
    <b>CLASS lcl_event_handler DEFINITION .</b>
    PUBLIC SECTION .
    METHODS:
    *--Hotspot click control
    handle_hotspot_click
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id es_row_no ,
    *--To control button clicks
    handle_button_click
    FOR EVENT button_click OF cl_gui_alv_grid
    IMPORTING e_oject e_ucomm .
    PRIVATE SECTION.
    ENDCLASS.
    <b>CLASS lcl_event_handlerIMPLEMENTATION .</b>
    *--Handle Hotspot Click
    METHOD handle_hotspot_click .
    PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
    ENDMETHOD .
    METHOD handle_button_click .
    PERFORM handle_button_click USING e_object e_ucomm .
    ENDMETHOD .
    ENDCLASS .
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    <b>*--Creating an instance for the event handler</b>
    CREATE OBJECT gr_event_handler.
    <b>*--Registering handler methods to handle ALV Grid events</b>
    SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
    SET HANDLER gr_event_handler->handle_button_click FOR gr_alvgrid .
    do n't forget to use<b> refresh_table_display
    </b> other wise only the record which you first you clicked will display in the 2nd container.
    <b>Reward points for useful Answers</b>

  • How to handle Text  change event in text box in SAP B1

    Hello Expert...
    How to handle Text  change event in source.
    Please define the Event when i change the text in textbox..
    currently i am using the Lost focus event but it is only occur when tab focus lost from that text box.
    So please required solution ASAP..
    Regards,
    Abhinav Lalpurwala
    Edited by: Abhinav Lalpurwala on Aug 5, 2011 3:19 PM

    Hi,
    Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
                If pVal.EventType = BoEventTypes.et_VALIDATE Then
                    If pVal.InnerEvent = False And pVal.ItemChanged Then
                        'TODO Your code here...
                    End If
                End If
    Regards,
    Vítor Vieira

  • How to handle the nonscriptable event by automation plug-in

    from the sdk document, the plug in for eventall just suitable for all the scriptalbe actions. Is there any way to handle the nonscriptable event such as drawing a line on the image ?
    Thanks in advance.

    You might get an answer in the scripting forum:
    http://www.adobeforums.com/webx?13@@.3bbf2765
    or the SDK forum:
    http://www.adobeforums.com/webx/.3bbc5053/

  • How to handle double click event in a text control

    Hi,
       Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.
    Regards,
    Praba.

    Hi Prabhavathi,
    Here is how you handle double click events in Textedit control.
    1)Create a custom control in screen (say TEXT_CONTROL)
    2)In main program,
    a) Declarations:
    data: obj type ref to cl_gui_custiom_control.
          text type ref to cl_gui_textedit.
    b) Create the instance of custom container
    c) Create the instance of textedit control.
    3)Now to handle double click events , create a local class as follows.
    class shail_event definition.
    public section.
    methods:
    handle_doubleclick for event dblclick of cl_gui_textedit .
    endclass.
    class shail_event implementation.
    method handle_doubleclick .
    here do the coding for handling the double click.
    endmethod.
    endclass.
    4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
    5) Define varibles for event.
    DATA: i_events TYPE cntl_simple_events,
          wa_events TYPE cntl_simple_event.
    SET HANDLER hand->handle_doubleclick for text.
    wa_events-eventid = cl_gui_textedit=>event_double_click.
    wa_events-appl_event = 'X'. "This is an application event
    APPEND wa_events TO i_events.
    6)
        CALL METHOD texte->set_registered_events
          EXPORTING
            events                    = i_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3
            OTHERS                    = 4.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
    If you want the program, kindly send your mail-id so that I can mail it to you.
    Regards,
    Sylendra.

  • Handling future dated events for automated provisioning

    Hi experts,
    has anyone implemented or knows how to handle future dated events such as going on and returning from leave for an employee within Identity Manager that it will schedule a provisioning process when the leave start end dates are given? any help is appreciated.
    birkoff77

    There is no explicit documentation on this requirement but if you look further in to the deferred task scanner and how to handle date events you will get any further probably. The point is that a provisioning process should start on a certain date for a certain user.
    One action to check for a date, another action to set up this process.
    Some hints:
    This is something you arange using the deferred task scanner which you can call by using 'application' as subprocess in the workflow....With the configuration of a task instance you can call a workflow (provisioning)...further specify a date argument and a name argument (the account Id).

  • Handling Touch Screen Events for Sony Ericsson P990i Phone

    Hello all,
    i recently just learned Java and i am trying to develop a GUI for a phone - P990i. I was wondering how i can handle touch screen events. Are there APIs for that or is it just a mouse event?
    Any help is very much appreciated.
    Thank you.

    Hello all,
    i recently just learned Java and i am trying to
    develop a GUI for a phone - P990i. I was wondering
    how i can handle touch screen events. Are there APIs
    for that or is it just a mouse event?
    Any help is very much appreciated.
    Thank you.Hi there,
    Have you found an answer for this question?
    Thanks.
    Tim

  • HOWTO: Handle a click event on a DAC TreeControl

    HOWTO: Handle a click event on a DAC TreeControl
    Goal: Handle the event that occurs when a user clicks on a new node of a DAC TreeControl. In this example the handler is simple - it just prints out the current node. You can try this example on the DACTree.jpr project in the 3.2 tutorial, described in the online help under
    Tutorials and Sample Applications
    -> Tutorials
    -> Building Enterprise Applications with Business Components for Java
    -> Enhancing the Online Orders Application
    -> Creating a DAC Client
    The problem: The usual procedure for adding an event to a DAC component does not work: if you select your TreeControl in the designer, then select the Events tab of the property inspector, none of the events listed does what we want.
    Solution: Get the underlying JTree and add your listener to it. Although the TreeControl is not a subclass of javax.swing.JTree, it does have an underlying JTree which you can get by calling TreeControl.getTree().
    Add the following code to your frame's .java file (Hint: Add any event, from the Events tab of the property inspector, then use the generated code as your template, changing it to match this example):
    1. Declare a JTree:
    JTree tree = new JTree();2. In jbInit(), add the event listener after the code that sets up your TreeControl:
    tree = treeControl1.getTree();
    tree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
    public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
    tree_valueChanged(e);
    });3. Add the event handler method:
    void tree_valueChanged(javax.swing.event.TreeSelectionEvent e) {
    System.out.println("Current node: " + tree.getLastSelectedPathComponent());
    }

    could you add a mouselistener to the pane or whatever container the pie chart is drawn on? Then override the mouseClicked method to do whatever you want?
    Message was edited by:
    petes1234

  • How to use peeklock/delete pattern to handle messages in event hub?

    Hi,
    I have a consumer group with multiple consumers. If one consumer failed to process the message (by some internal reasons. not poison), I want it just leave that message and let other consumers have chance to process it again. previous I use service bus queue/topic,
    the peeklock/delete pattern with the dead-letter queue can easily achieve this. Now by some reason I switch event hub,
    Is there still some way to achieve this? what is the recommended way to handle this in event hub?
    thanks!
    Robin

    There's no lock and delete concept in EventHubs. Please think EH as a stream of events where you can rewind back in time and start reading from wherever you want. For example as in your case if one of the clients fail to process an event any other client
    can start reading from that position where first client failed. Let me know if you have additional questions.
    I suggest you to read about EventProcessorHosts for EventHubs. This is probably what you're looking for.
    http://azure.microsoft.com/en-us/documentation/articles/service-bus-event-hubs-csharp-ephcs-getstarted/

Maybe you are looking for