Creating a Custom event for my Component

Hi All,
im currently working in a swing component, and i would like to know how to give to my component the ability to react to some user changes.
Basically im creating a DateTime Picker using NetBeans, im able to see any new property justed created on the Property Editor but i would like to know how to add my custom events on the Event Editor as well, i.e:
monthChanged - (when the user just change the month dropdown)
yearChanged - (when the user just change the year box)
dayChanged - (when the user just change the selection day)
Thanks in advance

Thanks, i just found it also here:
http://www.exampledepot.com/egs/java.util/CustEvent.html
i need to define the following class:
- Custom Listener extending the EventListener interface
- Custom Event extending EventObject class
and then finally add the corresponding:
addXXXListener
removeXXXListener
fireXXXEvent
in my component.
This work Great in the NetBeans GUI Builder.
Thanks,

Similar Messages

  • Possible to create a custom renderer for rendering standard component ?

    This is in context for creating dynamic Data tables. Is it possible to create a custom Renderer for rendering component (standard) without creating a custom component?
    namanc

    Let's assume you want to create a custom renderer which will be used to render the error-messages (the h:messages tag). The component-family in this case is: javax.faces.Messages, the renderer-type javax.faces.Messages.
    Therefor in your application's faces-config.xml add this renderer-statement (inside a render-kit, obviuosly):
    <faces-config>
      <!-- other stuff like components, managed beans, navigation-rules,... -->
      <render-kit>
        <renderer>
          <component-family>javax.faces.Messages</component-family>
          <renderer-type>javax.faces.Messages</renderer-type>
          <renderer-class>my.very.special.MessagesRenderer</renderer-class>
        </renderer>
      </render-kit>
      <!-- other renderers... -->
    </faces-config>The code for MessagesRenderer is very dependent on your needs, therefor I will not post something here. Basically you need to extend javax.faces.render.Renderer. For help in that camp, surf to the online tutorials or get yourself a book (I learned a lot from Kito Mann's "JSF in Action"). Additionally grab the source for Sun's RI AND Myfaces and dig into that java-code. There is a huge learning potential looking at that source-material.
    hth
    Alexander

  • Custom Event for Purchase Requisition Create, Change & Delete

    Hello Experts,
    I want to create a custom event which triggers on Purchase Requisition Create, SAP provide's standard event's for purchase requisition release but not for create.
    What are all the steps and how to create a new event.
    Thanks in Adavance,
    Sandhya.

    Hi Sandhya,
    may i know the reason why you are trying to create custom methods.
    You have business object BUS2009(for PR line item wise release) and BUS2105(for PR overall release).
    Both those business object have events RELEASESTEPCREATED (for PR creation) and SIGNIFICANTLYCHANGED(For PR change).
    Even then if you want to create custom events, create a subtype of the standard business object, then click on events, and then select create. Now create your Z-events, say ZCREATED (For creation), ZCHANGED (for changed) and ZDELETED (for deleted). Now select each event, click on edit -> Change release status -> object type component -> to be implemented. Follow the same for all the events. Then select each event, click on edit -> Change release status -> object type component -> to be released.
    Now click on your custom object, click on edit -> Change release status -> object type component -> to be implemented.Then click on your custom object, click on edit -> Change release status -> object type component -> to be released.
    After this in SWEC tcode, click on new entries. Select change document object as BANF, business object as say ZBUS2105 and event as ZCREATED. make sure radio button on create is checked.
    Similary create entries for ZCHANGED event and ZDELETED.
    Select on change and on delete radio button for event ZCHANGED and ZDELETED event respectively.
    let me know if you have any queries.
    Regards,
    Raj

  • I need create a custom control for visualization HTML

    Hi guys,
      I need create a custom control for HTML files visualization on SAPGUI JAVA. I created a sample program and perfectly run on SAPGUI Windows.
    Thanks.
    Regards.
    Jose Antonio Campos.

    Hi,
    Just as a quick start
    http://gumbo.flashhub.net/sizer/  (view source enabled).
    this uses a skin to make a titlewindow resizable, its not about the skin as much as giving you a starting point for resizing code.
    if you look into the skin you will see these functions
    protected function sizer_mouseDownHandler(event:MouseEvent):void
    OldX=event.stageX;
    OldY=event.stageY;
    systemManager.addEventListener(MouseEvent.MOUSE_MOVE,startResize);
    systemManager.addEventListener(MouseEvent.MOUSE_UP,endResize);
    protected function endResize(event:MouseEvent):void
    systemManager.removeEventListener(MouseEvent.MOUSE_MOVE,startResize);
    systemManager.removeEventListener(MouseEvent.MOUSE_UP,endResize);
    private function startResize(event:MouseEvent): void
    hostComponent.width -= OldX-event.stageX;
    hostComponent.height -= OldY-event.stageY;
    OldX=event.stageX;
    OldY=event.stageY;
    The idea is to have a hit area on your custom component (a corner, or all corners). You capture the mouseposition when you mousedown then in the mouse move eventlistener you update the object size with the difference between current X and Y from initial X and Y.
    Hope this gets you started.
    David

  • Missing Customizing settings for software component ECC-DIMP

    Hi all,
    While running the T-code IE4n I am getting this error:
    Missing Customizing settings for software component ECC-DIMP
    This is working fine in IDES ECC 6.0 ,Could u please tell me how to resolve it for my othersystems.
    Thanks
    Yinyan Lu

    Dear Yinyan Lu,
    Please, have a look into the SAP note 767108 (IE4N: Problems due to missing notification Customizing)
    Solution                                                                  
    To correct this error, implement the correction instructions contained    
    in this note or import the relevant Support Package.                                                                               
    In packages                                                                               
    o  DI in Release 4.6C2                                                                               
    o  DIMP in Release 4.71 and higher                                                                               
    o  EA-APPL as of Release 4.7 Extension Set 2 and higher                                                                               
    notifications are created when installing and dismantling. In this case,  
    Customizing must be complete, otherwise errors will occur.                                                                               
    In DI Release 4.6C2 and DIMP Release 4.71 (and higher),                   
    follow the following Customizing path:                                    
      Plant Maintenance and Customer Service                                  
        -> Maintenance and Service Processing                                 
          -> Maintenance and Service Notifications                            
            -> Determine Properties of Notifications for Installing and                                                                               
    Dismantling Parts                                                                               
    Always maintain the notification type for installation and for            
    dismantling.                                                                               
    Follow the following Customizing path on EA-APPL as of Release 4.7        
    Extension Set 2 (and higher):                                             
    follow the following Customizing path:                                    
      Plant Maintenance and Customer Service                                  
        -> Maintenance and Service Processing                                 
          -> Configuration Control                                            
            - > Determine Properties of Notifications for Installing and      
               Dismantling Parts.                                             
    Always maintain the notification type for installation and for            
    dismantling.                                                                               
    What must you do if you do not want to use notifications in IE4N?                                                                               
    1.  You must always maintain the notification type in accordance with     
        Customizing described above.                                                                               
    2.  Create an individual, empty implementation for the BADI               
        BADI_CCM_NOTIF_GENER. To do this, proceed as follows:                                                                               
    a) Execute transaction SE18.                                                                               
    b) Specify BADI_CCM_NOTIF_GENER as the BADI name.                                                                               
    c) Use the menu <Implementation><create> to create an individual      
           implementation with a corresponding name in the Z namespace.                                                                               
    d) You enter the BADI Builder. Name the implementation, and then      
           save and activate your implementation. It is important that the    
           methods CREATE, FILL_CUST_DATA, MODIFY, SET_HEADER_MESSAGE, and    
           PRINT_NOTIF are empty.                                                                               
    Note that these steps are required, since the BADI                    
        BADI_CCM_NOTIF_GENER is equipped with a default source code that      
        includes the use of the notification.                                                                               
    As of ECC600, Note 1368876 replaces error message IEN 126 with error      
      message IEN 026, which is more precise.                                                                               
    Caution:                                                                               
    o  The error message mentioned above indicates that Customizing is    
             missing. To correct the problem, you must perform the relevant     
             Customizing settings for transaction IE4N.                                                                               
    o  As of ECC600, you do not have to activate the DIMP switch (this    
             may not be useful).                                                                               
    o  For more information, see Note 1368876.                                                                               
    I hope, it helps.
    Best regards,
    Roland

  • Creating a application dynamically for a component

    Hi,
    Does any one know how to create an application dynamically for a component, so without using SE80?
    I already found class cl_wdy_md_application, but I do not know if this is the right direction. Maybe somebode already solved this issue.
    Regards,
    Remco

    Hi Thomas,
    In SRM it is possible to call own made webdynpro components and fill them with data, and then process these data into a new shopping card. This can be done by filling a so called HOOK_URL. In SRM you have to do customizing and fill in the URL to be used of the WebDynpro application. So far, still no problems.
    I have built a component by which an user can fill several Z tables and then he can display a form he has made by himself (a so called free order form). So the component will check all Z tables, and generate in one view, the context dynamically as also the layout dynamically. In all Z tables one field has been used as one of the keyfields and that is free order form name and this is also a parameter of the application so that this application knows which data to get from the Z tables to generate a form.
    And because it is possible to generate more then one forms, I have create per form 1 application with the specific parameter, and this URL can be entered in the customizing of SRM.
    This application creation I did myself, but now I want to accomplish, when the user creates a new form by filling specific tabels via webdynpro, that he can generate the application by himself.
    Maybe I can create a FM/BAPI for the BDC recording and then call this from my web dynpro application as there is no API.
    Do you maybe have another solution?
    Regards,
    Remco

  • Query regarding creating a Custom Event and Firing.

    I have created a custom event,a custom listener and a custom button.
    But when I click on custom button,my event is not being fired.
    When and how do I need to invoke the fireEvent() ?
    Please can any body tell me if I have overlooked any thing ?
    Thanks,
    // 1 Custom Event
    import java.util.EventObject;
    public class MyActionEvent extends EventObject{
            public MyActionEvent(Object arg0) {
         super(arg0);
    // 2 Custom Listener
    import java.util.EventListener;
    public interface MyActionListener extends EventListener {
          public void myActionPerformed(MyActionEvent myEvent);
    // 3 Custom Button
    public class MyButton extends JButton {
        // Create the listener list
        protected javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList();
          public MyButton(String str){
         super(str);
         public void addMyActionEventListener(MyActionListener listener) {
             listenerList.add(MyActionListener.class, listener);
        protected void fireMyActionEvent() {
            MyActionEvent evt = new MyActionEvent(this);
            Object[] listeners = listenerList.getListenerList();
           for (int i = 0; i < listeners.length; i = i+2) {
                 if (listeners[i] == MyActionListener.class) {
                      ((MyActionListener) listeners[i+1]).myActionPerformed(evt);
    } // end of class MyButton.
    // 4 Test my Custom Event,Listener and Button
    public class MyButtonDemo extends JPanel {
        protected MyButton b1;
        public MyButtonDemo() {
            b1 = new MyButton("Disable Button");
            b1.setToolTipText("Click this button to disable the middle button.");
            b1.addMyActionEventListener(new MyActionListener() {
         @Override
         public void myActionPerformed(MyActionEvent myEvent) {
         System.out.println("My ActionEvent....");
            add(b1);
        private static void createAndShowGUI() {
            JFrame frame = new JFrame("ButtonDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            MyButtonDemo newContentPane = new MyButtonDemo();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Hi Stan,
    I would like to use my custom action listener rather that using the the normal actionPerformed(ActionEvent e)
    But some how this event is not being fired.
    Any suggestions to fire this?
    b1.addMyActionEventListener(new MyActionListener() {
             @Override
             public void myActionPerformed(MyActionEvent myEvent) {
         System.out.println("My ActionEvent triggered....");
    });

  • How to create a custom measure for each level of a dimension

    Hi all!
    Can Anyone please explain me with an example, how to create a custom measure for each level for a dimension? I dont mine if you use
    one or more measures.
    thanks in advance
    hope someone helps me.

    For example:I create a dimension for product_dim witch has 4 levels:total, class, family and item:
    d_aben18
    n1_aben18
    n2_aben18
    n3_aben18
    n4_aben18
    herarchy:h_aben18
    cube:cubo_aben18
    measure:med_aben18
    I create this code to fetch the data to the dimension:
    TRAP ON CLEANUP
    SQL DECLARE c1 CURSOR FOR SELECT-
    total_product_id,1,'N1_ABEN18',total_product_dsc,-
    class_id,1,'N2_ABEN18',total_product_id,class_dsc,-
    family_id,1,'N3_ABEN18', class_id, family_dsc,-
    item_id,1,'N4_ABEN18',family_id,item_dsc-
    FROM PRODUCT_DIM
    "OPEN THE CURSOR
    SQL OPEN c1
    "FETCH THE DATA
    SQL FETCH c1 LOOP INTO-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N1_aben18_LEVELDEF,:D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N2_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N3_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N4_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    "SAVE THE CHANGES
    UPDATE
    COMMIT
    CLEANUP:
    SQL CLOSE c1
    SHOW 'KK2'
    Then I create a cube with use compression off, and in rules sum for example.
    After, I create a measure and I select Override the aggregation specification for the cube, in rules I put nonadditive and I would like to create aprogram to assign distinct values to each level of the dimension. For example, I put 1, 2 3, and 4 values, but at the end I would like to put count(distinct(values)).
    for that I create another program:
    VRB D_RETURN DECIMAL
    if D_ABEN18_N1_ABEN18_LEVELDEF eq 'N1_ABEN18'
    then D_RETURN = 1
    if D_ABEN18_N2_ABEN18_LEVELDEF eq 'N2_ABEN18'
    then D_RETURN = 2
    if D_ABEN18_N3_ABEN18_LEVELDEF eq 'N3_ABEN18'
    then D_RETURN = 3
    if D_ABEN18_N4_ABEN18_LEVELDEF eq 'N4_ABEN18'
    then D_RETURN = 4
    else d_return=26
    return d_return
    "SHOW D_RETURN
    cubo_aben18_med_aben18_stored=d_return
    but it doesnt work.I dont know how to put to assign or to see what I want.
    I report the measure, or I report the program, but then how can I see the values of the measure?
    thanks in advance

  • How can I create a custom dock for all users?

    Hello,
    I would like to create a custom dock for everyone that uses a certain Mac. I have found a bunch of stuff, but it is outdated. Most of the tutorials are for 10.4 or 10.5. I am using 10.7.4 and I have found nothing regarding that. Can anyone point me in the right direction?
    Thanks in advance

    Hello,
    I am not sure how I wound-up in the server forum. I am using the desktop version of OS X 10.7.4.
    Thanks

  • How to create a "Custom Color" for highlighting? (Acrobat XI)

    March 10, 2014
    How to create a "Custom Color" for highlighting? (Acrobat XI)
    The numbers in the RGB and other fields change as various numbers are changed.
    I wanted to create a pale orange:
    Hue               13      Red      255
    Saturation   240      Green  177
    Luminosity    86       Blue     140
    I'd selected one of the orange squares in the color grid, to display the general orange area of the slider.
    I moved the slider to select a pale orange, which generated the above numbers.   Since this wasn't directly available to save to a Custom Color, I tried to  edit the numbers.  Unfortunately, the other numbers changed, making it impossible to actually create a color.
    Any suggestions would be appreciated.
    Note:  I used Techsmith's Snagit to show screen shots in a Word document.
    When I attempted to browse and upload the file, the error message said "[The content type of this image is not allowed.]"
    OK...what images *are* allowed?

    Hi Don,
    I saw Gilad answered your question in another forum post.
    Do you have everything you need at this point?
    Let me know if you need further assistance.
    Kind regards, Stacy

  • I am getting ready to sell a Mac app and I want to know what the specs are to create a custom background for my Mac App?

    I am getting ready to sell a Mac app and I want to know what the specs are to create a custom background for my Mac App?
    Here is a good example of what I am talking about: https://docs.google.com/file/d/0B28kNqQ8gmifRjRHam9wVnlrWG8/edit?usp=sharing

    You need to post your question in the Apple Developer Forums

  • Create 1 customer master for some small customer

    Hi All,
    Our company have some small customer, sometime they buy our goods (may be they buy only one time). So we want create 1 customer master for them. Can we do it?

    Dear  ngocvt,
    Transaction Code: V-07 - Create a one-time customer. (Account Group - CPDA)
    One time customer / vendor accounts in SAP means they are account groups for customer/vendor and where in only the general data of the customer / vendor are stored instead of maintaining the bank data and other company code data that are relevant for other account groups which are useful for long run purposes.
    As you know everything that is entered in SAP is saved in some TABLE. Now the customer & vendor master is such a table which holds vast amount of data.
    The business secenario where the vendor or customer which are being in system only for 1 transaction, it is not advisable to have all the data maintained in main master.
    Therefore SAP has provided with the feature of One time vendor / customer wherein in the document entry stage only you have to enter the name, address and other details of the vendor/customer.
    The data, as far as I know' remains at doc level and does'nt go to the master tables.
    If you want to change the standard functionality then go to
    Transaction OBD2, u will find CPDA, that is standard one one time customer account group.
    Copy it  and make necessary changes.
    Hope this Helps.
    Thanks
    Murtuza

  • Using Apache Commons HTTPClient to create a custom socket for Java mail

    Does anyone know how to use Apache Commons HTTPClient to create a custom socket for Java mail. This is necessary for me to use NTLM authentication

    JavaMail doesn't use HTTP.
    If you want to add support for NTLM authentication to one of the standard protocols,
    your best bet is to create a SASL provider, although note that only JavaMail's IMAP
    provider uses SASL currently. The other protocols should add SASL support, but that
    hasn't been done yet.

  • Creating a custom scale for current

    Hi guys,
    I need some help with creating a custom scale. I am reading motor current (analog I/P) and would like to display that on a graph and write it to a file. I need to use a linear scaling for custom scale. The slope is 2 and the intercept is 0. I've attache the code to make it clear what I am trying to acomplish. The way I've set it up right now is no scaling. There are 2 tasks in the code. I would like to create a custom scaling for the first task as seen in the attached code. I have done custom scaling using DAQ Assistant Express VI. But I dont see such options when I try to do the same with the DAQmx task. Please let me know how this can be done. Any help is greatly appreciated.
    Thanks,
    Raj 
    Solved!
    Go to Solution.
    Attachments:
    Current_Voltage_RPM-_sub_VI-1.vi ‏18 KB

    You both had me going nuts trying to figure how to get to that property. Basically just right click the DAQmx property node and "Select filter..." . This brings up the "Configure Filter Settings" where I chose 'show all attributes'. I could then get to the AI Custom Scale Name property.
     Interestingly when you use the Property Browser and select the magnifying glass you can get to that property...but you just can't select it if you have the filter set incorrectly. Lesson Learned.
    I also found this community example and that one.  
    Using LabVIEW 2010SP1 and TestStand 4.5

  • How to create a custom variable for a Label?

    i need my label to store a string variable in it, do you know i can create a custom variable for it.
    i mean for example if it's name is "StoredString" i can access it in my code by "label1.StoredString" just like "Label1.text" or something like that.

    Thanks for pvdg42's help.
    Hi soorena12,
    Based on your issue, I suggest you can try the pvdg42's suggestion check your issue in your side.
    If it still could not help you solve this issue, I suggest you can tell me which kind of application you create the label in the VS IDE?
    What language you use to create for your application?
    If you have any update message about your issue, please tell us.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for