How to trap ENTER Key ????

I am doing setup wizard in my project. I trapped Enter key, if i press enter key to go to next screen, The behaviour of my wizard is unpredictable.

The same goes if you have a text field(s):
final JTextField tname = new JTextField(30);
final JButton ok = new JButton("OK");
tname.setText(nodeName);
tname.setMinimumSize(new Dimension(50,10));
tname.setSize(new Dimension(70,10));
tname.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {  //action on JTextField - pressing Enter
ok.doClick(); //or whatever you like
cp.add(tname);
cp.add(ok);
...

Similar Messages

  • How to make ENTER key in internet explorer run the  BIP report?

    In BI publisher 11g, users wanted that after entering the values for the parameter, they hit the ENTER key ( on the keyboard)  and the report should run .
    In Mozilla firefox, when I hit ENTER key on the keyboard report runs fine... but in Internet explorer, it does not ( infact in internet explorer TAB key works)
    How to make ENTER key in internet explorer run the report?
    Thanks
    Ashish

    Perform the following steps and tell us if it  resolve this issue:
    1. In Internet Explorer, click Tools, and then click Internet Options.
    2. Click the Security tab.
    3. There are four security zones listed:
    * Internet
    * Local intranet
    * Trusted sites
    * Restricted sites
    Click the zone being used by P6, which is noted at the bottom right hand corner of the browser window when the P6 URL is being accessed.
    4. Under Security level for this zone, click Custom Level.
    5. Under Downloads, under Automatic prompting for file downloads, click Enable, and then click OK two times.
    6. The browser will need to be restarted for the change to take effect.
    Refer to the following Microsoft Knowledge base article for additional file download and active x controls which should also be enabled: http://support.microsoft.com/kb/883255

  • How to trap ALT key?

    Hello guys!
    After searching and investigating quite a lot, I am posting
    my problem here in hope that God bless me with success
    I am working on an eLearning course whereas client requied
    the course to be keyboard accessible. He wants all the shortcuts
    with Alt key combination.
    I can trap the Alt key with the use of enterframe but that
    makes my course processing heavy so I tried to trap Alt key with
    keylistener event but unfortunately keylistener event doesn't
    listen Alt key
    Could anyone suggest me how to trap Alt key without using
    enterframe or interval?
    Thanks a lot for sparing your precisious time.

    I believe Alt-Space is a keyboard shortcut in Windows XP to bring up the window menu for any app...so it's not just a LabVIEW thing. Further, it appears that Windows grabs that key combination before a LabVIEW event structure can get it.  I don't know any way around this behavior, since Windows appears to be taking matters into its own hands with certain key combinations.  My advice would be to use a different key combination for your app.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Trap enter key? please help

    how will i trap the enter key?
    example: jTextField1 has the focus or insertion point, if the user presses the enter key from the keyboard the next focus or insertion point will be on jTextField2.
    thank you in advance.
    killuasoft

    Swing related questions should be posted in the Swing forum.
    By default a "Tab" key is used as the "focus traversal key". You can also add the "Enter" key as a focus traversal key to any given component.
    I'll let you read the Swing tutorial for information on how to do this.

  • How to handle 'ENTER' Key on ALV Editable Grid on sub screen (Tabstrips)

    Hello Experts ,
    I have 2 questions with ALV Editable grid;
    please help me if you have answers.
    I created ALV grid on one of sub screens on a Tab Strip,
    As soon as user types one of the columns of the ALV grid and press u2018ENTERu2019 key, it has to return corresponding details for that line.
    I tried to implement this logic in ALV grid event u2018handle_data_changedu2019, but ALV internal table is not getting populated with new entry entered in the grid. but u2018double_clicku2019 event working my purpose, but user might need enter key.
    and I thought I would do implement that logic in PAI event of the sub screen, u2018ENTERu2019 key not getting trigger on PAI event of the screen until cursor is on grid.
    Another question 2:  How do I control and not to be deleted a line on the grid (based on validation), where do I validate and by pass the delete function for a particular line, or suggest me to gray out only one line on the grid .
    I would like to have delete function to work as it is ,except for some validations..
    Can I implement using PAI event of the sub screen or any by ALV event.
    Please suggest me..
    Edited by: Ravindranath Arusam on May 13, 2010 2:42 PM

    In DATA_CHANGED event, you will get the modified row into the attribute MP_MOD_ROWS of the impoerting object ER_DATA_CHANGED. Since this MP_MOD_ROWS is the Object reference to Data, you need to have the field symbol to get the value.
      FIELD-SYMBOLS:  <lft_mod_output>  TYPE t_t_output.
      ASSIGN  er_data_changed->mp_mod_rows->* TO <lft_mod_output>.
    You can get the Value of the Cell by using the method GET_CELL_VALUE of the same ER_DATA_CHANGED object and use the method MODIFY_CELL To update the value back to ALV.
    To Restrict the row deletion:
    When the row is deleted it is being added to Attribute mt_deleted_rows of the object ER_DATA_CHANGED. You can put the data back to the table in the DATA_CHANGE_FINISHED event. Visit this post http://help-abap.blogspot.com/2008/10/alv-disable-delete-key-on-keyboard-in.html for more information.
    Regards,
    Naimesh Patel

  • How to disable "Enter" key - urgent

    - i have on my site one site password protected. Now i don't want that users cann use Enter key when they write password. Only when the click with mouse. For that i have onClick="..."
    How can i disable only enter key?
    Thanks

    Don't want the user to press the Enter key... who
    thinks up these ideas anyway? It never ceases to
    amaze me.Internet team in one of my early carrer companies were having problems with a search field on their web project... When the user pressed enter they were getting an error, but it worked when they clicked with the mouse.
    So they decided to remove the ability of the user to press enter, rather than figure out what was wrong and fix it... But they couldn't figure out how to disable the enter button either, so they just put red text below the search field asking users to click on the button and not to press enter...
    How the hell do some people get in the door in Software Companies?

  • How to change enter key behavior in data grid view?

    Greetings community
    I have a simple problem. I have a table of several columns, and I want it to be editable without using a mouse. I want user to enter value in the first column, press enter key on keyboard, enter value in second column, press enter key,
    and so on. I want data grid view to open another row only when all columns in the working row are populated. However, pressing the enter key causes opening new row whenever user presses the enter key.
    I tried to set current cell of data grid view in CellValueChanged event , but it didn’t work. Actually, it really moves current cell where I want, but after that it moves it one row down.
    I traced the execution of code, and counted CurrentCellChanged events to see what happens.
    Does anyone know if there’s any way to suppress this behavior?
    Thanks in advance

    Greetings community
    I have a simple problem. I have a table of several columns, and I want it to be editable without using a mouse. I want user to enter value in the first column, press enter key on keyboard, enter value in second column, press enter key,
    and so on. I want data grid view to open another row only when all columns in the working row are populated. However, pressing the enter key causes opening new row whenever user presses the enter key.
    I tried to set current cell of data grid view in CellValueChanged event , but it didn’t work. Actually, it really moves current cell where I want, but after that it moves it one row down.
    I traced the execution of code, and counted CurrentCellChanged events to see what happens.
    Does anyone know if there’s any way to suppress this behavior?
    Thanks in advance
    Hello,
    It perhaps be better using Tab key which is exactly used for switch focus to the next cell instead of dealing with enter key.
    Regards,
    Carl
    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.

  • How to catch enter key code

    Hi all,
    we are developed small application in swing, in that
    we extends Window class , we want catch the enter key code in window.
    bye
    N.S.

    Enter is caught just like any other key
    public class Gadget implements KeyListener
       public Gadget()
          this.addKeyListener(this);
       public keyPressed(Keyevent e)
          if (e.getSource() == VK_ENTER)
          System.out.println("You're in");
       //Add those other two keyThing functions as well

  • Who can tell me how replace a enter key!Thanks

    Because i can't let the enter key into the database!
    Thanks u!

    public String replaceEnter(String oldStr)
        String newStr = "";
        StringTokenizer st = new StringTokenizer(oldStr,"\r\n");
        //or StringTokenizer st = new StringTokenizer(oldStr,"\n");
        if(st.countTokens()==0) return oldStr;
        while(st.hasMoreTokens()) newStr+=st.nextToken()+" ";
        return newStr.trim();
    }You can use this method.
    Sudha

  • How to reattach enter key?

    I had to clean under some of my keys and all of them, except the enter key, went back on nicely. I've been trying for 2 months now and it just wont get back on probably!! Please help.

    That should work if none of the pieces got lost or flew off somewhere. I have not attached a key to a MBP keyboard, yet. I have had a few popped off on the regular Mac keyboard and a few laptops. There are a few very small hinge like plastic pieces that have to fit together then you can push down on the key to snap it into place. If it will not work just drop by an Apple Store if there is one close by and they should be able to help you without sending it off. Good Luck!

  • Compare PDF: How to simulate ENTER Key programmatically to suppress the dialog box.

    Hi,
    We are using Acrobat 8.0. Using Visual Basic, we are opening two PDF files in Acrobat 8.0 professional.We are comparing those two documents using MenuitemExecute(DIGSIG:CompareDocuments ) command and generating the side by side comparison file programatically.
    During this process after executing the command "MenuitemExecute(DIGSIG:CompareDocuments )" adobe is displaying "Compare Documents" dialog box where the user need to click OK on it in order to continue with the comparison.
    My requirement is to suppress the dialog box and automate the process. Our application is developed in Visual basic.
    Could you please let me know how to suppress the dialog box using Visual basic. Is it possible using VB or any alternatives for this. Because we need to compare many PDF documents so clicking OK every time requires user intervention.
    Thanks for your help in advance.

    I did not say that AVCommand simulates pressing enter - it is used to automated methods by pre-filling options and not showing the dialogs. Please read the documentation on the AVCommand methods.
    You should also note that I said AVCommand is only available to plug-ins, which means it will not work with a VB.NET application.
    SendKeys is a basic VB.NET command, it is not part of the Acrobat SDK in any way. Here is Microsoft's documentation on SendKeys. Again I will state that using this method is NOT a good idea for a production environment.
    http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx

  • How to prevent Enter key from closing form?

    I have a page with a single text entry field on it. When I press enter the page closes, not saving the data (it is as if I clicked cancel). How can I change this behavior?

    Hi Daveio,
    Can you please let me know whether the Text Field that you have created is of type:
    Text Field (always submit page when entered pressed)?
    Secondly, does your page have any branches associated with it?
    Tony.

  • How to use enter key instead of save button in tabular form?

    Hello,
    is there a way to save data entered into a tabular form by clicken enter instead of "submit/save" button?
    We got it working for normal forms but not for tab. forms
    Regards
    Friedrich

    Hi Friedrich,
    try to enter
    onkeypress="return submitEnter(this,event)"into "Element Attributes" of your tabular form column.
    If you hit enter, the page will be submitted with request set to the id of the tabular form column.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • How to define 'Enter' key in the input filed?

    Hi experts,
    I used the 'split string_a at '##' into internal table', in my program,
    when I use it like this :split 'aa.##bb' at '##' into table_a.
    it's successed and the value in the table is like this:
    line    value
    1        aa.
    2        bb
    but when the value of the string is not hard code but got in the input field, like I typed a sentence :aa.(press ''Enter'' in the keybord)bb
    in the program I catch the value of my input is shows like this: aa.##bb
    so I pass the value to string_a and used split again but the value of the internal table is:
    line    value
    1        aa.##bb
    so the split is not successful.
    would you please help me with this?
    Thank you for your time.

    Hi, nana.
    I have written a sample code like this:
    types: begin of typ_tab,
             str type c length 10,
           end of typ_tab.
    data: tab_tab type standard table of typ_tab,
          wa_tab  type typ_tab.
    selection-screen begin of block b1 with frame.
      parameters p_str type c length 10.
    selection-screen end of block b1.
    start-of-selection.
      split p_str at '##' into table tab_tab.
    end-of-selection.
      loop at tab_tab into wa_tab.
        write / wa_tab-str.
      endloop.
    You said that like I typed a sentence :aa.(press ''Enter'' in the keybord)bb in the program I catch the value of my input is shows like this: aa.##bb. But I found that the value is AA.BB.
    Maybe I was wrong, please reply me.
    Regards,
    feng.

  • Enable enter key

    How to enable enter key in adobe flex builder 2

    An easy way to enable the enter key for all buttons (when
    they have the focus)
    is to
    - on each button add a click event handler that does what
    the button needs to do
    - Just add a keyDown Handler to the component that contains
    the buttons
    - In the key down handler check for the enter key, and if the
    target is a button.
    If so then dispatch a button click event.
    In the code below if the user tabs to a button and presses
    enter
    the button will be clicked.
    See below
    private function handleKeyDown(event:KeyboardEvent):void
    var char:uint = event.keyCode;
    var enterChar:uint = 13;
    var tabChar:uint = 9;
    var pgUp:uint = 33;
    var pgDown:uint = 34;
    if(char == enterChar)
    if(event.target is Button)
    var bt:Button = event.target as Button;
    if(bt.enabled == false || bt.visible == false)
    return;
    var c:MouseEvent = new MouseEvent(MouseEvent.CLICK,true);
    bt.dispatchEvent(c);
    return;

Maybe you are looking for