What is an event handler..?

I'm trying to learn how to make responsiveness UI. I've read that I can not use SwingUtilities.invokeLater() method if I am in a event handler. The question can seems stupid but I'm only a beginner: what is a event handler? From what I know it might be the actionPerformed method..is it right? Could somebody give me an example? thanks!

Basically an event handler is a class that performs code.
It can be any class (even the same that fires the event), but it has to implement the proper interface for the event you want to catch. If you want to perform special code when someone clicks on a button you want to catch an Action, therefor you need an ActionListener, a class that either implements the ActionListener interface (and therefor the method actionPerformed) or your class has to extend AbstractAction (and therefor has an actionPerformed, too).
It you want to perform special code when someone chooses an element from a list, you want to be informed about a ListSelectionEvent and therefor need a class that implements the ListSelectionListener Interface (and provides the method selectionChanged).
The class that should react on the event has to be declared as being a listener to the object that fires the events. So an actionListener on a Button would be added by
button.addActionListener(listener);or
button.setAction(action);(Note that all variables used are just for clarifiing the type you need and have to be exchanged by the names of your declared objects)
There are many more events ... really, read the tutorial!

Similar Messages

  • What type of event handling does the JList has?

    hello
    I know how to use handling using " anonymous inner class " when handling a JList, I don't like this way it is so confusing I would like to use the same way of handling JButton like this:
    class Class1 extends JFrame implements ActionListener
    //and the method is this one
    public void actionPerformed( ActionEvent event )it is much better than the anonymous class. What is the handler of selecting in JList? is it this one?
    ListSelectionListener
    and the method is this?
    public void valueChanged(ListSelectionEvent e)
    I'm new in GUI Components so that's why I want to get used to the same old way of handling that I learned earlier :)
    Could you provide me with an example please?
    thank you

    Have a look at [Selecting Items in a List|http://java.sun.com/docs/books/tutorial/uiswing/components/list.html#selection] in Sun's Tutorial. The ListDemo class implements ListSelectionListener.

  • Event handler - open with explorer issue

    hi all,
    I have developed an event handler (itemadded syncronuos) for a library. i need to populate title field
    public override void ItemAdded(SPItemEventProperties properties)
    base.ItemAdded(properties);
    properties.ListItem["Title"] = "some value"
    properties.ListItem.SystemUpdate();
    I have deployed the same feature to 2 environments -> Dev Env, Test Env.
    when I copy and paste a pdf file with "Open with explorer" in Dev Env it works fine.
    when I do the same in Test Env i can't copy the file and i get this error: 
    Error 0x80070057: the parameter is incorrect.
    I see this in my Event Viewer
    The description for Event ID 14901 from source WebClient cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
    If the event originated on another computer, the display information had to be saved with the event.
    Could you help me?
    Thanks.
     

    On your local machine you are as you on the server, are you try it on the test server or browsing the test environment from local machine and doing the copy from local machine.  also i hope your event handler is not firing on all the list, just make
    sure. You can try this in a different library..create a fresh library and see what happen without event handler.
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • Making a cutsom event handler for nodes

    hi i was wondering how to go about making a custom eventhandler class for nodes
    for eg. if a have a circle (c1) in the main.fx file
    and i want to assign it Mouse and Key events(using onMousePressed etc)
    but i dont want to write it in "c1"'s definiton directly coz i want the event handling code to be useful for another circle i may create later(call it c2)
    can some tell me how to go about it ?
    Appreciated. :-)
    UPDATE:
    ok i just realized that i could simply write a modified Circle class extending the Circle class.
    So i can just create a new modified Circle object when needed.But how do i exactly write the class.The fixed variables i can simply override.But what about the event handling properties of the circle,how do i make sure they are initialzed for that object when the modified Circle object is created? what is the syntax??
    Edited by: apratim_pranay on Apr 22, 2010 6:16 AM

    hey i tried making a circle class like the above..
    drag works fine..
    thing is.. i've nested some effects..which "SHOULD" toggle on on keypresses ,but even though the key press is detected..effects dont appear..
    public class modCircle extends Circle{
    var c1e2:Glow;
    var c1e4:Reflection=Reflection {bottomOpacity:0.0 topOpacity:0.5
                                 fraction: 0.75 topOffset: 0.0};
         override var centerX=40;
         override var centerY=199;
         override var radius=40 ;
         override var fill= Color.BLACK;
         override var effect=c1e2=Glow {level:0.1 input:c1e4};
    override def onMouseEntered= function( e: MouseEvent )
                              {requestFocus();}
    override def onKeyPressed= function (e: KeyEvent): Void
                               if(e.code==KeyCode.VK_G)
                                   if(c1e2.level==0.1)
                                    {c1e2.level=0.9}
                                   else
                                    {c1e2.level=0.1}
                                 if(e.code==KeyCode.VK_M)
                                   if(c1e4.topOpacity==0.5)
                                     c1e4.fraction= 0.75;c1e4.topOffset= 0.0;
                                     c1e4.topOpacity= 0.5;c1e4.bottomOpacity= 0.0;
                                   else
                                     c1e4.fraction= 0.75;c1e4.topOffset= 0.0;
                                     c1e4.topOpacity= 0.5;c1e4.bottomOpacity= 0.0;
    }why is this happening??

  • How would I....?  (Event Handling)

    Let me first start by explaining what I am needing. I am given a JFrame containing a JButton and 8 JTextFields (in the form of an array). Right now I let the button be clicked no matter what is in the fields. What I would like is to limit the button's availablility based on the fields' content. The fields are being used as a form to fill out and the button is being used to save the form. What type of event handler would I use to enable the button only if the fields' contents are not empty? I have added an ActionListener to the button but for that to work the button needs to be enabled. I would like to keep the button completely disabled until the proper fields have been filled out.

    I'm not sure which listener is best for your situation, maybe a DocumentListener. Regardless, you will have to create a component of some sort that listens to all text fields for changes. When it detects a change it should look at whether or not all fields are empty and enable or disable the button. Implementing this is pretty easy, for example you could iterate over each field checking the length of the String getText() returns, but that wouldn't be terribly efficient, what the best solution is I'm not sure. I think I might just keep a boolean isEmpty for each field, then for each field add a different listener that modifies that boolean to true whenever the field is empty and false whenever it's not. Would be less overhead with checking every field then, you could simply have every listener call an "updateButton()" method that would check the boolean values and enable or disable the button if necessary.
    This belongs in the Swing forum, post future Swing questions there, but don't repost this one please.

  • Javascript error in event handler! edge 4.0.0.js, what to do about it?

    Site
    Hello everyone. I get an error in my chrome cosole, what can I do about this?
    I dont have this problem in all browsers, just in chrome, and in some versions of Firefox.
    The problem occurs when I click any label in the iframe (see website, speaks for itself).
    line 5838      window.console.log("Javascript error in event handler! Event Type = " + eventType);
    does anyone know how to fix this?
    And why do I only have this problem in some browsers?

    I basically want the labels in the Iframe to make the parent page animate to a specific anchor tag.
    ps. This is what I posted on the jquery forum as well:
    I tried to do this by letting the iframe .trigger a .click to a button on the .parent page.
    I did this in two ways.
    one: the click is triggerd in (/by) the iframe
    two: the click is triggerd by a script in the parent window, that script is launched by the iframe
    Here's the thing:
    this is what one of the <a>'s that the iframe will click looks like:
    <a class="nonblock nontext anim_swing" id="u185" href="index.html#contact"><!-- simple frame --></a>
    The code is generated by adobe muse which has a function to smoothly scroll to a location on the page, and I am guessing the "anim_swing" class takes care of that.
    I would like the colorful labels in the iframe to do the same thing as the <a> above.
    and it works in some browsers on some computers but somehow not on all of them (with method two the adblocker doesn't seem to be an issue ).
    I also tried to let the parent page scroll directly with the jquery .scrollto function. That did not work either (see the jquery forum).

  • What event handling code do I need to access a web site ?

    Hello
    I am doing a GUI program that would go to a program or a web site when a button is clicked. What event handling code do I need to add to access a web site ?
    for instance:     if (e.getSource() == myJButtonBible)
              // go to www.nccbuscc.org/nab/index.htm ? ? ? ? ? ? ?
            } below is the drive class.
    Thank you in advance
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.JEditorPane.*;
    public class TryGridLayout
      public TryGridLayout() {
        JFrame myJFrame = new JFrame("Choose your program");
        Toolkit myToolkit = myJFrame.getToolkit();
        Dimension myScreenSize = myToolkit.getDefaultToolkit().getScreenSize();
        //Center of screen and set size to half the screen size
        myJFrame.setBounds(myScreenSize.width / 4, myScreenSize.height / 4,
                           myScreenSize.width / 2, myScreenSize.height / 2);
        //change the background color
        myJFrame.getContentPane().setBackground(Color.yellow);
        //create the layout manager
        GridLayout myGridLayout = new GridLayout(2, 2);
        //get the content pane
        Container myContentPane = myJFrame.getContentPane();
        //set the container layout manager
        myContentPane.setLayout(myGridLayout);
        //create an object to hold the button's style
        Border myEdge = BorderFactory.createRaisedBevelBorder();
        //create the button size
        Dimension buttonSize = new Dimension(190, 100);
        //create the button's font object
        Font myFont = new Font("Arial", Font.BOLD, 18);
        //create the 1st button's object
        JButton myJButtonCalculator = new JButton("Calculator");
        myJButtonCalculator.setBackground(Color.red);
        myJButtonCalculator.setForeground(Color.black);
        // set the button's border, size, and font
        myJButtonCalculator.setBorder(myEdge);
        myJButtonCalculator.setPreferredSize(buttonSize);
        myJButtonCalculator.setFont(myFont);
        //create the 2nd button's object
        JButton myJButtonSketcher = new JButton("Sketcher");
        myJButtonSketcher.setBackground(Color.pink);
        myJButtonSketcher.setForeground(Color.black);
    // set the button's border, size, and font
        myJButtonSketcher.setBorder(myEdge);
        myJButtonSketcher.setPreferredSize(buttonSize);
        myJButtonSketcher.setFont(myFont);
        //create the 3rd button's object
        JButton myJButtonVideo = new JButton("Airplane-Blimp Video");
        myJButtonVideo.setBackground(Color.pink);
        myJButtonVideo.setForeground(Color.black);
    // set the button's border, size, and font
        myJButtonVideo.setBorder(myEdge);
        myJButtonVideo.setPreferredSize(buttonSize);
        myJButtonVideo.setFont(myFont);
        //create the 4th button's object
        JButton myJButtonBible = new JButton("The HolyBible");
        myJButtonBible.setBackground(Color.white);
        myJButtonBible.setForeground(Color.white);
    // set the button's border, size, and font
        myJButtonBible.setBorder(myEdge);
        myJButtonBible.setPreferredSize(buttonSize);
        myJButtonBible.setFont(myFont);
        //add the buttons to the content pane
        myContentPane.add(myJButtonCalculator);
        myContentPane.add(myJButtonSketcher);
        myContentPane.add(myJButtonVideo);
        myContentPane.add(myJButtonBible);
        JEditorPane myJEditorPane = new JEditorPane();
        //add behaviors
        ActionListener myActionListener = new ActionListener() {
          public void actionPerformed(ActionEvent e) throws Exception
            /*if (e.getSource() == myJButtonCalculator)
              new Calculator();
            else
            if (e.getSource() == myJButtonSketcher)
              new Sketcher();
            else
            if (e.getSource() == myJButtonVideo)
              new Grass();
            else*/
            if (e.getSource() == myJButtonBible)
               // Go to http://www.nccbuscc.org/nab/index.htm
        }; // end of actionPerformed method
        //add the object listener to listen for the click event on the buttons
        myJButtonCalculator.addActionListener(myActionListener);
        myJButtonSketcher.addActionListener(myActionListener);
        myJButtonVideo.addActionListener(myActionListener);
        myJButtonBible.addActionListener(myActionListener);
        myJFrame.setVisible(true);
      } // end of TryGridLayout constructor
      public static void main (String[] args)
        new TryGridLayout();
    } // end of TryGridLayout class

    Hello
    I am doing a GUI program that would go to a program or a web site when a button is clicked. What event handling code do I need to add to access a web site ?
    for instance:     if (e.getSource() == myJButtonBible)
              // go to www.nccbuscc.org/nab/index.htm ? ? ? ? ? ? ?
            } below is the drive class.
    Thank you in advance
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.JEditorPane.*;
    public class TryGridLayout
      public TryGridLayout() {
        JFrame myJFrame = new JFrame("Choose your program");
        Toolkit myToolkit = myJFrame.getToolkit();
        Dimension myScreenSize = myToolkit.getDefaultToolkit().getScreenSize();
        //Center of screen and set size to half the screen size
        myJFrame.setBounds(myScreenSize.width / 4, myScreenSize.height / 4,
                           myScreenSize.width / 2, myScreenSize.height / 2);
        //change the background color
        myJFrame.getContentPane().setBackground(Color.yellow);
        //create the layout manager
        GridLayout myGridLayout = new GridLayout(2, 2);
        //get the content pane
        Container myContentPane = myJFrame.getContentPane();
        //set the container layout manager
        myContentPane.setLayout(myGridLayout);
        //create an object to hold the button's style
        Border myEdge = BorderFactory.createRaisedBevelBorder();
        //create the button size
        Dimension buttonSize = new Dimension(190, 100);
        //create the button's font object
        Font myFont = new Font("Arial", Font.BOLD, 18);
        //create the 1st button's object
        JButton myJButtonCalculator = new JButton("Calculator");
        myJButtonCalculator.setBackground(Color.red);
        myJButtonCalculator.setForeground(Color.black);
        // set the button's border, size, and font
        myJButtonCalculator.setBorder(myEdge);
        myJButtonCalculator.setPreferredSize(buttonSize);
        myJButtonCalculator.setFont(myFont);
        //create the 2nd button's object
        JButton myJButtonSketcher = new JButton("Sketcher");
        myJButtonSketcher.setBackground(Color.pink);
        myJButtonSketcher.setForeground(Color.black);
    // set the button's border, size, and font
        myJButtonSketcher.setBorder(myEdge);
        myJButtonSketcher.setPreferredSize(buttonSize);
        myJButtonSketcher.setFont(myFont);
        //create the 3rd button's object
        JButton myJButtonVideo = new JButton("Airplane-Blimp Video");
        myJButtonVideo.setBackground(Color.pink);
        myJButtonVideo.setForeground(Color.black);
    // set the button's border, size, and font
        myJButtonVideo.setBorder(myEdge);
        myJButtonVideo.setPreferredSize(buttonSize);
        myJButtonVideo.setFont(myFont);
        //create the 4th button's object
        JButton myJButtonBible = new JButton("The HolyBible");
        myJButtonBible.setBackground(Color.white);
        myJButtonBible.setForeground(Color.white);
    // set the button's border, size, and font
        myJButtonBible.setBorder(myEdge);
        myJButtonBible.setPreferredSize(buttonSize);
        myJButtonBible.setFont(myFont);
        //add the buttons to the content pane
        myContentPane.add(myJButtonCalculator);
        myContentPane.add(myJButtonSketcher);
        myContentPane.add(myJButtonVideo);
        myContentPane.add(myJButtonBible);
        JEditorPane myJEditorPane = new JEditorPane();
        //add behaviors
        ActionListener myActionListener = new ActionListener() {
          public void actionPerformed(ActionEvent e) throws Exception
            /*if (e.getSource() == myJButtonCalculator)
              new Calculator();
            else
            if (e.getSource() == myJButtonSketcher)
              new Sketcher();
            else
            if (e.getSource() == myJButtonVideo)
              new Grass();
            else*/
            if (e.getSource() == myJButtonBible)
               // Go to http://www.nccbuscc.org/nab/index.htm
        }; // end of actionPerformed method
        //add the object listener to listen for the click event on the buttons
        myJButtonCalculator.addActionListener(myActionListener);
        myJButtonSketcher.addActionListener(myActionListener);
        myJButtonVideo.addActionListener(myActionListener);
        myJButtonBible.addActionListener(myActionListener);
        myJFrame.setVisible(true);
      } // end of TryGridLayout constructor
      public static void main (String[] args)
        new TryGridLayout();
    } // end of TryGridLayout class

  • What is the correct process to return errors from an Event Handler

    I have a pre-Create and pre-Modify Event Handlers. If the event handler detects an error, I want to throw an exception back to terminate the create user or modify user event. I also want to display a meaningful error message on the OIM UI. In my pre-modify event handler I am throwing the following exception when an error is detected:
    throw new EventFailedException(processId, null, "User ID not available", "", "MODIFY", null);
    However, the OIM UI is not displaying the message "User ID not available" as I want it to. Instead it is displaying the following error message:
    An error occurred. The corresponding error code is IAM-0080062
    Does anyone know where that error code is coming from? My event handler is not doing that. Also, does anyone know where I can find any documentation on the proper use of the EventFailedException? What do the parameters mean? How do I get a meaningful error message to display on the OIM UI?
    Thank you for any help here.
    -Dave

    Please try to cancel the PO 1st and then Cancel Sales order...
    Refer following note id
    How to Cancel a Drop Ship Order Line (Doc ID 393688.1)
    Thanks

  • Event handler method definitions - whats the difference

    hi folks,
    i'm a newbie and have just started trying to get my head
    around flash 8 actionscript.
    is anyone able to advise me what is the
    distinction/difference/subtlety between defining an event handler
    method ON a keyframe as compared to defining an event handler
    method WITHIN a keyframe.
    evidently this is a keypoint to understand so if i don't get
    this clear i expect it'll cause me grief later.
    thanx for your response.
    regards,
    avonova

    I wouldn't say ON a keyframe, that sounds like on a frame. I
    believe you mean the difference between on(clip event) which is
    placed on an instance of a movieclip or myClip.onClipEvent which is
    code placed on a timeline/frame.
    Thanks aniebel for that link. David Stiller is a genius and
    really hit the point.
    For me code consolidation is certainly the biggest reason for
    it as well. But from that you start to see ways to put your code
    together that are just better and lead naturally into OOP style and
    concepts.
    avonova – it is totally worth learning how to do it
    this way. In AS3 you will no longer be able to use any of the
    on(clipEvent) style coding. (Still supported in CS3 if you publish
    to earlier versions of AS2 or 1.)

  • What is Triggering and Handling Events  in ABAP  OOPs

    Gowri

    ) TYPE type ..
    To declare static events, use the following statement:
    CLASS-EVENTS ... ...
    It links a list of handler methods with corresponding trigger methods.  There are four different types of event.
    It can be
    ·        An instance event declared in a class
    ·        An instance event declared in an interface
    ·        A static event declared in a class
    ·        A static event declared in an interface
    The syntax and effect of the SET HANDLER depends on which of the four cases listed above applies. 
    For an instance event, you must use the FOR addition to specify the instance for which you want to register the handler.  You can either specify a single instance as the trigger, using a reference variable
    After the RAISE EVENT statement, all registered handler methods are executed before the next statement is processed (synchronous event handling).  If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.
    Handler methods are executed in the order in which they were registered.  Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.
    "Example  :
    REPORT demo_class_counter_event.
    CLASS counter DEFINITION.
      PUBLIC SECTION.
        METHODS increment_counter.
        EVENTS  critical_value EXPORTING value(excess) TYPE i.
      PRIVATE SECTION.
        DATA: count     TYPE i,
              threshold TYPE i VALUE 10.
    ENDCLASS.
    CLASS counter IMPLEMENTATION.
      METHOD increment_counter.
        DATA diff TYPE i.
        ADD 1 TO count.
        IF count > threshold.
          diff = count - threshold.
          RAISE EVENT critical_value EXPORTING excess = diff.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    CLASS handler DEFINITION.
      PUBLIC SECTION.
        METHODS handle_excess
                FOR EVENT critical_value OF counter
                IMPORTING excess.
    ENDCLASS.
    CLASS handler IMPLEMENTATION.
      METHOD handle_excess.
        WRITE: / 'Excess is', excess.
      ENDMETHOD.
    ENDCLASS.
    DATA: r1 TYPE REF TO counter,
          h1 TYPE REF TO handler.
    START-OF-SELECTION.
      CREATE OBJECT: r1, h1.
      SET HANDLER h1->handle_excess FOR ALL INSTANCES.
      DO 20 TIMES.
        CALL METHOD r1->increment_counter.
      ENDDO.
    The class COUNTER implements a counter. It triggers the event CRITICAL_VALUE when a threshold value is exceeded, and displays the difference. HANDLER can handle the exception in COUNTER. At runtime, the handler is registered for all reference variables that point to the object.
    Reward  points if it is usefull ...
    Girish

  • What is event handler in oopsand why we need it  and how to use it ?

    Hi  everyone ,
    I am new to sdn.I did not understand event handler  in oops .Please replay to this .
    Thanks & Regards,
    Sudeep Subudhi.
    Moderator Message: Welcome to SDN. Please read the [Forum Rules of Engagment|Welcome and Rules of Engagement; before posting your question.
    Edited by: Suhas Saha on Jan 9, 2012 2:51 PM

    EDIT: BAH! I posted too slow... but there is still some information about saving and clearing in there
    Its for making a playlist while your 'on the go'. So you click and hold the middle button the selected song (or album) should flash... Then you go into the playlist menu (music>playlists>on-the-go) and use it like any normal playlist...
    When there's songs on the playlist it gives you the option to save or clear at the end of the song list, you select either one and it'll ask for conformation.
    It works in both manually sync and auto sync mode. But if you have it on auto sync the play list will be created in iTunes...
    So I'm not sure why you don't see songs in it after yo assign them to it, try sending a whole album and then music>playlists>on-the-go the album songs should be listed.
    As for reasons to use it well maybe while out and about you realise that you want to hear from two artists at the same time, Radiohead and Bowie, in a shuffle mode. You could make it a on-the-go playlist. Or there's a few podcasts you want to hear in order... so you go down the list and assign them to on-the-go.
    Some people use the On the go to note songs that need to be looked at in iTunes later, maybe because its too quiet, badly imported or they don't understand how such a bad song found its way onto the iPod.
    Once you save it if you try and put more songs to it, 'on-the-go-1' will be created.
    -hope this helps

  • What's different between event handle by bsp frame & MAC

    Hi,
    Can anyone know the different between event handle by BSP frame & handle by MAC?
    and how to know which event is handle by BSP frame or MAC?
    thanks
    Gang

    Hi Abdul,
    So that means the add_entry event is standard event handle by BSP frame.
    thanks
    Gang

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Unable to get automatic event handling for OK button.

    Hello,
    I have created a form using creatobject. This form contains an edit control and Search, Cancel buttons. I have set the Search buttons UID to "1" so it can handle the Enter key hit event. Instead its caption changes to Update when i start typing in the edit control and it does not respond to the Enter key hit. Cancel happens when Esc is hit.
    My code looks like this -
    Dim oCreationParams As SAPbouiCOM.FormCreationParams
            oCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
            oCreationParams.UniqueID = "MySearchForm"
            oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
                    Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.AddEx(oCreationParams)
    oForm.Visible = True
    '// set the form properties
            oForm.Title = "Search Form"
            oForm.Left = 300
            oForm.ClientWidth = 500
            oForm.Top = 100
            oForm.ClientHeight = 240
            '// Adding Items to the form
            '// and setting their properties
            '// Adding an Ok button
            '// We get automatic event handling for
            '// the Ok and Cancel Buttons by setting
            '// their UIDs to 1 and 2 respectively
            oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Search"
            '// Adding a Cancel button
            oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 75
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Cancel"
    oItem = oForm.Items.Add("NUM", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 105
            oItem.Width = 140
            oItem.Top = 20
            oItem.Height = 16
            Dim oEditText As SAPbouiCOM.EditText = oItem.Specific
    What changes do i have to make to get the enter key to work?
    Thanks for your help.
    Regards,
    Sheetal

    Hello Felipe,
    Thanks for pointing me to the correct direction.
    So on refering to the documentation i tried out a few things. But I am still missing something here.
    I made the following changes to my code -
    oForm.AutoManaged = True
    oForm.SupportedModes = 1 ' afm_Ok
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Visible, 1, SAPbouiCOM.BoModeVisualBehavior.mvb_Default)
            oButton = oItem.Specific
            oButton.Caption = "OK"
    AND
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.AffectsFormMode = False
    I get the same behaviour OK button changes to update and enter key does not work.
    Could you please tell me find what is it that i am doing wrong?
    Regards,
    Sheetal

  • Input value given on web page is not getting pickedup in event handler

    Hi friends,
    I have created one simple page in SE80 with program with flow logic option, in which I would like to show business partner details from BUT000 table with the input of partner number. But the thing is the input value(partner no.)which I am giving on web page is not getting picked up in selection in event handler though I am giving input value it is becoming initial while selecting. What could be the reason?
    Below I am mentioning the code which I have written in even handler for OnInputProcessing event.
    CASE EVENT_ID.
    WHEN 'select'.
    NAVIGATION->SET_PARAMETER( 'partner' ).
    SELECT * FROM but000 INTO TABLE I_but000 WHERE partner BETWEEN partner AND partner1.
    WHEN OTHERS.
    ENDCASE.
    Thanks in advance,
    Steve

    Hi Abhinav,
    I tried with the one you posted. But it is giving run time error as shown below.
    Note
    The following error text was processed in the system CRD : Access via 'NULL' object reference not possible.
    The error occurred on the application server crmdev_CRD_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: ONINPUTPROCESSING of program CLO24DDFJW575HVAQVJ89KWHEHC9OCP
    Method: %_ONINPUTPROCESSING of program CL_O24DDFJW575HVAQVJ89KWHEHC9OCP
    Method: DO_REQUEST of program CL_BSP_PAGE===================CP
    Method: ON_REQUEST of program CL_BSP_RUNTIME================CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_HTTP_EXT_BSP===============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    Regards,
    Steve

Maybe you are looking for

  • How do i get my phone to connect to iTunes after plugging it in to my computer and disconnecting it?

    So I tried connecting my phone to iTunes, but it doesn't show up. It will connect to my computer, but not to iTunes. What do I do?

  • Problem launching Excel sheet from Button hyperlink

    Re: Access 2010 / Excel 2010 on Win 7 Professional The Problem: ============= When I try to launch an Excel file (Dashboard sheet) from a hyperlink in a command button in an Access app, I get this error in the form of two message boxes: Message box:

  • File association problems

    this is on a mac. I went to a class and photoshop was having issues opening its files. All files that shoud open with photoshop cs2 are trying to open with cs3. Cs3 wass installed a year ago so the teacher could give it a try. it was a trial vesion.

  • How can I review calls made on my iphone from 90 days ago?

    I'm trying to review local calls made on my iPhone from January - March for busienss purposes. I understand there are Apps I can download to assist in retrieving & sorting through all call smade and received. Has anyone had any experiennce with these

  • HD for regular ipod podcast

    Hi All I have looked through the forums, but still haven't seen an answer to this. I feel like i'm being stupid with it, or that i'm missing something. . . . Right, i have a clip that is in HD. I want to render out a version that could be used as a P