HOW to simulate the enter key???

Hi , I have a jTable ,and i want that by leaving a specific
cell ,to perform the same action that the enter key does!
when im leaving my specific cell the following function is being called:
public void editingStopped(ChangeEvent e) {
//here I want to simulate the enter-key's action
HOW to simulate the enter key???
10x in advance
Nir.
p.s. My initial problem was that when i left my specific
cell (the cell is editable combo box), an edited words
which were written by me vanished , and when i get back to that cell the edited word showed again!!!
when i pressed the enter key the edited word were stable in the cell!!!
when I chose a word from the combo evrything was ok!!
so if any one can solve me that problem ill be appreciate.
thanks Nir

yourActionListener.actionPerformed(new ActionEvent(yourCell))
I am not sure about the constructor of actionevent.
you could try if setText(getText()) produces a good result

Similar Messages

  • How to press the enter key then execution Form?

    Using:SAP B1 UI Form for C#
    How to press the enter key then execution Form?
    thanks
    Edited by: JackyChang on Jul 5, 2010 5:35 AM

    Hi JackyChang,
    Use the SendKeys method.
    VB Sample
    oApplication.SendKeys("{ENTER}")
    Regards,
    Vítor Vieira

  • Help!! I can't find how to get the enter key......

    Hi...
    I am information technology student. I am now first year second semester
    I need help because I don't know how to catch the enter key in JTextField.
    I want to submit the form when user press the enter key in JTextField....
    I only can find KeyEvent.VK_ENTER ( actually that is not what I want)
    Another thing is
    "How to add a JMenuItem into a JMenuItem...."
    I want to do like this.... When you click the "Tools bar" in View item.. another menu comes out...???"
    He he... I hope you all can understand what I mean.. because I know my english is not so good... because I am from Myanmar.
    for(int i=0;i<1;i--)
    System.out.println("Thanks A lot");
    Thu Rein Nyo...
    You also can reply by e-mail.. thanks

    Hi...
    I am information technology student. I am now first
    year second semester
    I need help because I don't know how to catch the
    enter key in JTextField.it can be done easily by adding an actionListener to the JTextField. So when u enter something in the field and press enter the event will be caught and the code which u write in that will get executed.
    Eg:
    JTextField.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    Your code comes here.
    Another thing is
    "How to add a JMenuItem into a JMenuItem...."
    I want to do like this.... When you click the "Tools
    bar" in View item.. another menu comes out...???"I think you are gettin confused with JMenu and JMenuItem. What u need to do is create a JMenu add another JMenu to it and add JMenuItems to it.. and ur problem will be solved.
    He he... I hope you all can understand what I mean..
    because I know my english is not so good... because I
    am from Myanmar.
    for(int i=0;i<1;i--)
    System.out.println("Thanks A lot");
    Thu Rein Nyo...
    You also can reply by e-mail.. thanks

  • How to fix the enter key not opening sites in the URL box?

    Ever since the update to 10.0.1 pressing enter to open a site in the URL entry box doesn't work. Anyone know why? I have to click the arrow key to the side of the URL pannel, and enter key works as normally everywhere.
    It is INCREDIBLY annoying.

    Try disable "AVG Safe Search", that should work.

  • How to make the enter key act as a button?

    I have a CREATE and UPDATE button and I would like the user just to be able to press enter and perform the create or update as appropriate as if the button was pressed.
    Thanks in advance for your help.
    Greg

    Greg,
    Use the following so you don't loose the delete message:
    <script type="text/javascript">
    //<![CDATA[
       htmldb_delete_message='"DELETE_CONFIRM_MSG"';
       document.onkeypress = keyHandler;
       function keyHandler(e) {
          var keycode;
          var id = $v('PXX_ID');
          if(window.event){keycode = window.event.keyCode;
          }else if(e){keycode = e.which;
          }else{return true;}
          if (keycode == 13){
             if (id) {
                doSubmit('UPDATE');
             } else {
                doSubmit('INSERT');
             return false;
          }else{
             return true;
    //]]>
    </script>What is the name of your primary key item?
    Are you getting any JavaScript errors?
    Did anything happen?
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    http://sourceforge.net/projects/plrecur

  • In ALV display model ,how to accept the ENTER key event?

    Dear All,
    I have used ALV by  GRID DISPLAY model ,not class model.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          i_structure_name         = 'T_ITAB'
          is_layout                = gs_layout
          it_fieldcat              = t_fieldcat[]
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = t_itab
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    For example :
    IN ALV DISPLAY, there are two fields, one is MATNR, the other is MAKTX.
    When user input the material value in MATNR field and press ENTER, then ALV can run my code to select the MAKTX into MAKTX field and display it synchronization.
    Now I have realized update edit in ALV,but I found only I double click ALV row, then the MAKTX can update.
    Please give me help,
    Thanks
    Sun

    This is the document written by me on Interactive ALV.. hope this maybe helpful for u..
    When an Interactive Report is needed in Classical Display, we go for AT LINE-SELECTION. But when the same is needed in ALV Display, this method won't work. Instead, we need to use other way which is explained below:
    We use REUSE_ALV_GRID_DISPLAY for ALV Display. Now, normally we call that FM in the following way:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = 'PROGRAM_NAME'
                it_fieldcat             = tb_fieldcat
           TABLES
                t_outtab                = tb_output.
    When it is needed to get an Interactive ALV, call the same FM in the following manner:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = 'ZTEST75599_1'
                it_fieldcat             = tb_fieldcat
                i_callback_user_command = 'USER_COMMAND'
           TABLES
                t_outtab                = tb_output.
    Now, in the report, create a subroutine with the name USER_COMMAND as follows:
    FORM user_command  USING p_ucomm    LIKE sy-ucomm
                             p_selfield TYPE slis_selfield.
      CASE p_ucomm.
        WHEN '&IC1'.   " &IC1 - SAP standard code for double-clicking
    Based on the requirement, write the logic                          *
      ENDCASE.
    ENDFORM.
    No need to call the subroutine as PERFORM user_command. This will be takane care by REUSE_ALV_GRID_DISPLAY. We need to just write the subroutine in the report. That suffices.
    Some more useful points for Interactive ALV:
    1. If Hotspot is needed, then that should be done by declaring hotspot (one field in slis_t_fieldcat_alv) as 'X' in tb_fieldcat which is of type slis_t_fieldcat_alv. When hotspot is active, single click will be enough or else you should double click on the output data.
    2. In Classical Display, when it is needed to read the record on which we double clicked, we do that in following way:
       AT LINE-SELECTION.
           GET CURSOR LINE wf_line. " wf_line gives the line number on which it has been clicked
             READ LINE wf_line OF CURRENT PAGE.
      But this won't work for ALV. Instead, the following logic can be used:
    FORM user_command  USING p_ucomm    LIKE sy-ucomm
                             p_selfield TYPE slis_selfield.
      CASE p_ucomm.
        WHEN '&IC1'.   " &IC1 - SAP standard code for double-clicking
          READ TABLE tb_output INTO wa_output INDEX p_selfield-tabindex.
          IF sy-subrc EQ 0.
    Based on the requirement, write the logic                          *
          ENDIF.
      ENDCASE.
    ENDFORM.

  • How to make the Enter key close a JDialog?

    I have a dialog box which extends JDialog. I have several buttons and other components, but I would like to make the OK button the one which reacts when the user presses Enter. Are there any specific methods to get this behaviour?

    dialog.getRootPane().setDefaultButton(okButton);

  • Remove the Enter key binding from a JPopupMenu

    Hi,
    Does anyone know how to remove the Enter key binding from a JPopupMenu?
    So when the popupmenu is showing and you type Enter, nothing should happen and the menu should stay where it is.
    I have tried:
    popup.getActionMap().put("enter", null);
    popup.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");but the popup always disappears.
    Any ideas?
    Cheers,
    patumaire

    First of all, that is not the proper way to "remove" a key binding. Read the Swing tutorial on [How to Use Key Bindings|http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html#howto] for more information.
    However, we still have a couple of problems:
    a) the input map is dynamically built as the popup menu is displayed
    b) the input map is built for the root pane, not the popup menu
    The following seems to work:
    popup.show(...);
    InputMap map = getRootPane().getInputMap(JTable.WHEN_IN_FOCUSED_WINDOW);
    map.put(KeyStroke.getKeyStroke("ENTER"), "none");
    KeyStroke[] keys = map.allKeys();
    for (int i = 0; i < keys.length; i++)
         KeyStroke key = keys;
         Object action = map.get( key );
         System.out.println(key + " : " + action);

  • Customizing the "enter" key

    Does anyone know how to reset the "enter" key (to the right of the right-hand "command" key) on the iBook G4 keyboard so that it functions as a second "control" key? I've heard that this is possible, but the Keyboard & Mouse pane in System Preferences seems to be no help with this. I've just begun using emacs, which requires the "control" key all over the place, and it would be really nice to have "control" keys on both sides of the keyboard.
    Thanks,
    Nick

    Hi Nick,
    that's excellent. However, please keep in mind that this app is a "hack" as much as the "handmade" one in the link I gave you. Therefore you should always check the developers website for any known incompatibilities before you perform any system upgrade or things may go haywire.
    Take care,
    -Petra

  • When I type an address in the location bar and hit Enter nothing happens. I must click the arrow button at the end of the location bar. How do I fix it so that the Enter key works?

    When I type a web address in the location bar and hit enter nothing happens. In order to go to the website I've typed in, I must click the arrow button at the end of the location bar. How do I make it so that hitting the enter key takes me to the web page.
    == This happened ==
    Every time Firefox opened
    == Since Firefox 4 Beta installed an update

    The AVG addon seems to have caused the problem for me. I had it disabled and everything worked. Then I updated to AVG 2011 and the problem occurred. It seems to have reenabled itself after the update.
    Just disabling it solved the problem.

  • How can I use the enter key instead of tab to change field focus?

    I am using Acrobat 9 Pro.
    We have a fillable PDF where the users enter numbers into fields.  They want to be able to use the <enter> key on the 10-key pad instead of the <tab> key on the keyboard to move the focus to the next data entry field.
    How can I set my PDF so that it recognizes the <enter> key instead of the <tab> key for changing focus?
    Thanks!

    You can use a custom Keystroke script, something like:
    // Custom Keystroke script for text field
    if (event.willCommit && event.commitKey === 2) {
        getField("Text2").setFocus();
    Where "Text2" is the name of the next field. This doesn't disable the Tab key though. For more information, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.608.html

  • I can't use the 'Enter' key to take me to a website I've typed into the nav bar - I have to use the mouse to click on the 'go' arrow. Why? How do I fix this?

    I can't use the 'Enter' key to take me to a website I've typed into the nav bar - I have to use the mouse to click on the 'go' arrow. Why? How do I fix this?

    See:
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How do I remove  the enter key on the numeric keypad as a command key?

    How do I remove the enter key on the numeric keypad as a command key.  I want to use the enter key as a return key.

    Don't.  It will void the warranty.  Take is to an Apple store or an AASP and have them do it.

  • How can i disable the Enter key in JTextArea?

    How can i disable the Enter key in JTextArea?
    When i press Enter key in JTextArea,I hope JTextArea do nothing.
    Thanks!

    HI, I've the same problem;
    uncle_alice solution works fine, but if I paste in textArea a multi-line text,
    this last results on more lines (rows);
    Isn't possible to avoid this?
    Alternatively, how can I disable cut/copy/paste on TextArea?
    Thank you in advance.
    MargNat
    Message was edited by:
    MargNat

  • I'm using LR 5.6.  The Enter key should increase the exposure but it increases Contrast instead.  How can I make the Enter key adjust the exposure?

    Hello
    As explained in the heading, I'm using LR 5.6 on a PC (Win 7).  The Enter key should increase the exposure but it increases Contrast instead.  How can I make the Enter key adjust the exposure, as it should?  I have reset the settings to Default in the Develop module but to no avail.  Please help!  Thanks.
    Kind Regards
    Farrukh Hyder

    I am not aware that the ENTER key should increase exposure, and it certainly does not increase exposure (or any other slider) on my Lightroom 5.6 (Windows 7)
    If you click on the word Exposure, then the + and - keys increases or decrease exposure by 0.1 or -0.1

Maybe you are looking for

  • Upload very large video from my itouch4 !

    Hi I try to upload on my computer a very large video that i have recorded (1.60 gigs for 22 minuts) with my itouch 4 but doesnt working ?. I use Windows XP-3. I think it is because this video are too big for Windows but not sure .. Have you an idea h

  • Disabling built-in isight

    I'd like to learn how to disable the isight camera when it's not in use. I read a report about a flaw in the codeing where someone can come into my computer and use the isight to view what I'm doing. Call me paranoid, but that's messed up. And even i

  • Best way to create a form that can be emailed and also secured down.

    Hi, I work in a manufacturing company that tests each raw material as it comes in the door. The results from the tests are currently handwritten on a template form that is printed first. The sheets are then sent to another department who types up the

  • IPod Touch 2 gen (16 GB) will not update

    My iPod Touch will not update to version 3. iTunes stops in the middle of the process of downloading the update file, and tells me the network connection has been reset. I have also tried restoring it, but the same thing happened and now the iPod wil

  • Cannot scroll or resize

    Hello I installed Java Java Plug-in 1.5.0_05 Using JRE version 1.5.0_05 and when the applet window loads it is a frame with no scrollbars and cannot be resized,I reinstalled two times but it remains the same so if I am viewing an applet window or pla