Making Enter key work

I have made a GUI and I want to make the 'Enter' key work on dialog boxes to operate the ok , button if it is the only button on the dialog box.
I have used the setMnemonic method for all the other buttons on other dialog boxes, but i don't want to have to press alt-Enter - i just want to be able to press Enter is this possible
cheers
David

To make a 'Default' button (that has a darker border, and will be pressed whenever Enter is pressed, look at getRootPane().setDefaultButton(button) called on a JDialog or JFrame. The keystroke for pressing a button with focus is actually Space.

Similar Messages

  • Make enter key work as tab in apex

    Hi ,
    I have one form it contains 15 fields . to navigate from one field to next field i have to use enter key instead of TAB key.
    is there any solution.
    Thanks
    Sagar

    Hello Vikram,
    Big Fan of you, you've helped me a lot in my query hope you'll do so this time too
    need help here :make enter key work as tab in apex
    $(document).ready(function() { $('input').keydown( function(e) { var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; if(key == 13) { e.preventDefault(); var inputs = $(this).closest('form').find(':input:visible'); inputs.eq( inputs.index(this)+ 1 ).focus(); } }); });
    This works fine on tabular forms if there are existing records but as soon as I hit add rows hitting enter does not move the cursor, can you help 

  • 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.

  • Making ENTER key act as a TAB key.

    I have a version problem that I could not solve. My goal is using ENTER key as TAB key.
    In java version 1.3.X my code is working properly.It is like the code below
    public void keyPressed(KeyEvent e) {
    if(e.getKeyCode() == KeyEvent.VK_ENTER) e.setKeyCode(KeyEvent.VK_TAB);
    In java version 1.4.X it is not working. Can anybody help me please?

    Thanks a lot. It is really a good document that everybody should read.
    I have copied some portion of it for others searching about this topic.It is below.
    KeyListeners installed on Components will no longer see KeyEvents that map to focus traversal operations. Previously, AWT Components saw these events and had an opportunity to consume them before the AWT initiated focus traversal. Code that requires this functionality should instead disable focus traversal keys on its Components and handle focus traversal itself. Alternately, the code can use an AWTEventListener or KeyEventDispatcher to pre-listen to all KeyEvents.

  • Why isn't the enter key working in InDesign?

    I have installed Adobe InDesign CS6 as creative cloud but pressing the enter key on the numbers keypad doesn't move my text to the next page as it should but just drops it to the next line. What can I do to resolve this?

    Windows Laptop? Some of them have both the enter keys mapped together, and changing the state of the Numlock will swap between functions. If that's you, edit the shortcuts so bothEnter keys are a paragraph break, and make a new shortcut for page break (Numpad enter is actually a column break, by default).

  • How to make 'Key-Enter' trigger (when clicked on enter key)work like 'F8' key?

    Hi . I have another question to be asked.
    Oracle Forms 6i.
    I have a form in which DEFAULT&SMARTBAR is the menu and there are no push buttons.
    In the form, there is a 'field' named as 'ID No'. After entering 'ID No' in the field and click on 'Execute Query' button from the 'DEFAULT&SMARTBAR' menu, all the details of that respective 'ID No' gets displayed in all the other fields. Even if i press 'F8' all the fields gets displayed with the values.
    But i have a requirement, i.e. after entering 'ID No' and click 'Enter' key , i want all the values to be displayed.
    So i created a 'Key-Enter' trigger with the following code:
    BEGIN
      EXECUTE_QUERY;
    END;
    But after entering 'ID No' and click 'Enter' key, the values are not getting displayed.
    What can i do to make this happen?
    Thank You.

    It depends how your form is created. If your ID item is part of the base table block, you can do this.
    On your ID item, create a KEY-NEXT-ITEM trigger:
    if :system.mode = 'ENTER-QUERY' then
        execute_query;
    else
        next_item;
    end if;
    Now
    - User clicks on enter query (via smart bar icon or F7).
    - User enters ID and clicks <enter> key to execute the query.

  • Enter Key works same as button click

    .

    Tharpa,
    You can make your search field a text field with submit. This will submit the page and make the request the name of the item when the user presses enter while this field has focus.
    I cannot currently look at a 3.2 instance and be more descriptive about how you can do this, but if i remember correctly it was a sub option of the text field.
    Thanks,
    Tyson Jouglet

  • Enter key doesnt work in SQL developer

    enter key doesnt work in sql developer so cant creat new line in code.
    enter key works fine when use word etc
    Can I fix this in the SQL developer settings somewhere.?
    thanks in advance.

    Hi Sue,
    Just to let you know, your solution worked... My SQL Developer got into a state again where the backspace key stopped working... doing 'load preset, default' on the accelerators did fix it. Strange, because I don't use/configure the accelerators at all. Thanks for that, and hopefully this will be permanently fixed in the next version.
    To echo what I think someone else was trying to say... I also have the issue that sql developer will 'lock up' or get bogged down sometimes, when i'm just typing away in the worksheet. Any keystrokes I entered in though will always get entered into the worksheet, once sqldeveloper 'unfreezes' itself. Of course, this issue is an annoyance factor only (little bit of impact on productivity though), but hopefully it gets fixed as well.

  • The "enter" key on the numeric keypad of my external mac keyboard has stopped working. Help!

    The "enter" key on the numeric keypad of my external mac keyboard has stopped working with my Macbook pro.  If I plug the keyboard into any other computer, that entier key works fine. I'm using a standard Mac wired keyboard, & it's worked fine for 2 years now. Help!
    This is the keyboard I am using: http://store.apple.com/us/product/MB110LL/B/apple-keyboard-with-numeric-keypad
    Not sure what I might have accidentily done to disable the enter key. (The normal enter key works fine, just the one on the numeric keypad.)
    Thank you for your help.

    Hi there,
    Do you have any resolution to this problem in the end? Because it happened to me an exact same thing.
    Please share if you have found a solution to your problem. I also cannot think of what I did wrong to disable the Enter key.
    Best Regards,
    Jeffri

  • My enter key doesn't work in the address bar so I can't manually enter URLs

    This is actually on my wife's computer but, apparently she recently upgraded to 3.6.13 and now the enter key doesn't work in the address bar. I can enter a URL but can never go to it because the enter key is totally non functional in the address bar. Chrome works fine and other apps work fine. The enter key works here in this text box and in the search area but not in the address bar. Weird huh!

    In my Windows 7 64, my Java was update, but dissabling AVG search and restarting the problem was solved
    Thanks a lot

  • Buttons and enter key problem

    hello,
    there are a few projects of enterprise quality which I am developing in java swing. I found out through research that many or rather most people involved with java believe that swing is ready for enterprise class robust desktop applications.
    so I as the team leador am starting my new projects in java swing.
    I personally find that the amount of java libraries present provide a rich set of functionality and it gives big mussle power to the developers.
    I am only concerned about one problem which many of you might have solved.
    I find that I have to hit the space bar instead of enter key to fire an action. in languages like vb I can press enter key to fire the click events. specially in menu items I certainly don't expect my clients to press the spacebar. besides there are many people who are so used to the keyboard and enter key in particular that it will be hard or rather next to impossible to change their habbits.
    how can I make the menu items work with the enter key. I mean do I need to create the code for keypress events every time I also create an action performed method? or is there a way where I can do it without extra coding.
    it is just that I don't want to right extra code for enter key along with click events.
    one more important note.
    I am a blind person and I use the access bridge technology of java.
    so when I am involved in coding, I use the same.
    so may be my problem isn't a problem in the first place.
    kindly provide me some help
    thanks
    Krishnakant.

    The enter-key works on menu-items in all my applications. It did so since I started with java few years ago.
    Maybe some other problem (OS-specific) ?

  • JFileChooser - activating buttons with the enter key

    Hi All,
    I am trying to figure out how to activate the cancel button in the file chooser by tabbing to it, and than pressing the enter key. I know how to do this in a regular dialog, but I can't seem to get the access I need to the JFileChooser to get it to work there.
    I would appreciate any help.
    Thanks!
    robinste

    The Buttons in the File Chooser by default dont use the Enter Key.
    You must make the Enter key work if you are to use it
    after you tab to get the focus on to it.
    For this to be done you will need to extend the FileChooser
    and change the key listener for the cancel button .......
    Hope t was of some help ............

  • Pressing ENTER key on a page

    In an ADF Faces application is there a setting that allows a user to respond to a button by pressing the ENTER key instead of usering the mouse? Is this a browser function or an application function?
    Dev env: JDeveloper 10.1.3.3.0.
    TIA,
    Dave

    Thanks for the reply.
    I checked the defaultCommand property of af:form and it has loginButton. The ID on the login button has loginButton1 but I'm not sure that is an issue because on some PC's the ENTER key works as expected.
    I appreciate the clue though and will look further.
    Dave

  • 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.

  • TS1381 the enter key on my numeric keypad brings up the Start menu in Windows 7

    The enter key on my wired iMAC numeric keypad is not working correctly - it brings up the Start menu in Windows 7.  I am running Windows 7 through Parallels.  Any ideas how to switch it back?

    I figured this out on my own.  I had clicked a key in DoubleClick that was causing this.  I unchecked it and now my enter key works normally.

Maybe you are looking for

  • Moving time-dependant data from one table to another (archiving)

    Hello all I would like to know if there's an easier solution or a "best practice" to move data from one table to another. The context of this issue can be found within "archiving". More concretely: we have an application that uses several tables to l

  • [SOLVED]Video device file switches when starting Motion in daemon mode

    I am not sure whether this should be here or in Kernel and Hardware. Motion live stream shows gray frame which says "Unable to open video device" and /var/log/errors.log gives: Failed to open video device /dev/video0: No such file or directory Could

  • Arabic-language search limitations in RH HTML 6?

    Our Middle-Eastern translator, who is using version 6, is having problems when she tries to search. Her question is: "Can we search for Arabic text in the search or index fields of help created with RoboHelp or . . . are these functions not supported

  • What is the mac equivalent to adobe acrobat?

    what is the mac equivalent to adobe acrobat?

  • Validation in MIRO

    Hi, I have a requirement to produce an error message in MIRO when an invoice is being processed for a vendor within a certain WT category and the W/tax base FC is blank. I am able to get an error for this using validation but it doesnt seem to recogn