Avoiding key ENTER to "click" OK Button

I have a JDialog with a Canvas inside. I have to handle the keyboard event generated when user presses ENTER in order to write somethig in the Canvas. My event listener is able to handle it. The problem is that the dialog's OK button receives the event too and the dialog is closed as if the user has clicked on it.
What could I do?

Thank you guys, but your solutions have not worked.
When the user presses ENTER, the OK Button is "clicked" even when it doesn't have the focus. JOptionPane creates this button as the "active" one and I don't know how to avoid this behavior.
I've already tried this:
pane = new JOptionPane(...);
JRootPane root = pane.getRootPane();
root.setDefaultButton(null);
It hasn't worked ... NullPointerException in that third line.
And when I tried to getRootPane after creating the Dialog, the setDefaultButton(null) had no effect.
Any other ideas?

Similar Messages

  • Can't delete mail by delete key, or by clicking 'delete' button of the mail.

    Thunderbird version: 24.5.0
    When I press delete key, or click 'delete' button, nothing happens. I must click right mouse button on the mail, select 'move to -> local directory -> trash' to delete it.

    I followed the instrution to delete the trash and trash.msf files, then restart Thunderbird, but I still cannot delete mails by clicking nor pushing delete button.

  • Why does firefox 16.0.1 not allow me to click on buttons in the top 40mm below the banners, though i can get to them by tabbing to a buttons then press "Enter"?

    It doesn't matter what web-page I'm on, the top 40mm or so of the screen is a dead area for clicking on buttons or links. e.g. in Google I can click on a link lower down the page and get transferred to the new article - but if I were to move the item up nearer the top of the page the link would no longer operate.
    I can move to a link by repeated operation of the "Tab" key until the link or button is indicated, and then press "Enter" to use the link, but this is potentially very time-consuming if there are a lot of links on the page.
    I'm using a Toshiba Satellite L750 loaded with Windows 7, and Firefox 16.0.

    Problems with buttons and links at the top of the page not working can be caused by an extension like the Yahoo! Toolbar or a Babylon extension that extents too much downwards and covers the top part of the browser window and thus makes links and buttons in that part of the screen not clickable.
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode

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

  • AS 3 Convert button event to key enter event

    I'm learning how to use regular expressions in ActionScript
    3, and can get an input to be tested by regular expressions, and an
    answer delivered, if a button is clicked after text is entered.
    But darn if I can figure how to code it so they just click
    the enter key after typing what they like. In the following code
    punk is a button, and there are two text fields, buzzo the input,
    and tester the answer to the input. The array questo contains the
    regular expressions, the array anso contains the responses.
    I need code to replace the bottom line with a line that
    relates to key enter being typed. Thanks for any ideas.
    Sally

    This will work if the code is on the timeline:
    var quest0:RegExp = /i was/i
    var quest1:RegExp =/\bbud(dy)?|mate/i
    var quest2:RegExp =/how old|\bage\b/i
    for(i=0;i<3;i++){
    questo.push(this["quest"+i])
    trace(questo[1])
    Another method might be to add your RegExp objects to a
    Object, and then
    iterate the Object's properties and add the RegExp objects to
    your array:
    import flash.utils.getQualifiedClassName;
    var RegExpContainer:Object = new Object();
    RegExpContainer.quest0:RegExp = /i was/i;
    RegExpContainer.quest1:RegExp =/\bbud(dy)?|mate/i;
    RegExpContainer.quest2:RegExp =/how old|\bage\b/i;
    for(var p in RegExpContainer){
    var o = RegExpContainer[p];
    if (getQualifiedClassName(o) == "RegExp"){
    questo.push(o);

  • Movie contains buttons with keys assigned. Both work. If you click a button first, keys wont work.

    I created a project with a menu of 7 buttons. The client has the option to click the buttons to view a different scene or use keyboard events. Each scene has been assigned a number when using the keyboard. The mouse and keyboard events function successfully. But I noticed if I start the movie by using the mouse, then the keyboard events will not work any more. One of the keys is important since it is the only way to play frame to frame. Anybody have a clue why this happens?It is as if though I have to tell the client,  don't click the buttons or the keys won't work.
    Below are actionscripts for the movie. I added actionscript for each scene for the keyboard events. In the menu, the movieclip contains the actionscript for the mouse events.
    Scene 1:
    import flash.events.KeyboardEvent:
    stage.addEventListener(KeyboardEvent.KEY_UP, onKeyEvent1);
    function onKeyEvent1(e:KeyboardEvent):void {
    var character:String=String.fromCharCode(e.charCode);
    if (e.keyCode==72) {
      gotoAndStop(1,"master");
    if (e.charCode==49) {
      gotoAndPlay(1,"Distributor");
    if (e.charCode==50) {
      gotoAndPlay(1,"Mirka");
    if (e.charCode==51) {
      gotoAndPlay(1,"Farm");
    Menu Movieclips:
    master.addEventListener(MouseEvent.CLICK, mouseDownHandler1);
    function mouseDownHandler1(event:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"master");
    distribute.addEventListener(MouseEvent.CLICK, mouseDownHandler2);
    function mouseDownHandler2(event:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Distributor");
    health.addEventListener(MouseEvent.CLICK, mouseDownHandler3);
    function mouseDownHandler3(event:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Mirka");
    mirka.addEventListener(MouseEvent.CLICK, mouseDownHandler4);
    function mouseDownHandler4(event:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Farm");
    transaction.addEventListener(MouseEvent.CLICK, mouseDownHandler5);
    function mouseDownHandler5(event:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Check2");
    transaction2.addEventListener(MouseEvent.CLICK, mouseDownHandler6);
    function mouseDownHandler6(event:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Check3");
    sceneA.addEventListener(MouseEvent.CLICK, mouseDownHandler7);
    function mouseDownHandler7(e:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Scene2");
    sceneB.addEventListener(MouseEvent.CLICK, mouseDownHandler8);
    function mouseDownHandler8(e:MouseEvent):void {
    MovieClip(root).gotoAndPlay(1,"Scene1");

    In addition to my question, I'm opening the SWF file in a utility program IrfanView which the client uses for offsite purposes. Therefore, the SWF works fine in Flashplayer 10. I can crossover using mouse and keyboard events. But in IrfanView, the program will not allow me to crossover mouse and keyboard events.

  • Can avoid the entering my username and password always when i click on URL

    Hi,
    Iam new to BSP,i developed a simple BSP application to display a list of orders on the second page when a cutomer is entered in the first page. it is working fine.
    when i test the BSP application, it is asking for username and password.when i entered my username and password it is working fine.
    Then my question is when i test the BSP application, can i avoid the entering the username and password always.
    is there any way we can avoid the entering my username and password always when i click on the URL.
    Thanks
    Srinivas Manda

    sure.
    You can include the password and the username in the BSP link :
    <bsp_lnk>?sap-client=<client>?sap-user=<username>?sap-password=<password>
    where:
    <client>  = client where the username and password are defined
    <bsp_lnk> = your bsp link
    <username> = your username
    <password> = your password
    Regards,
    fabrizio

  • HELP!! My mac keeps on clicking up arrow key when i click the o button!?

    I own a macbook its about 3 years old. Today morning after using my mac for few hours whenever i clicked the O button the text kept on moving up. I opened on screen keyboard to see which all keys were getting clicked when i click the o button and saw that my up arrow key was getting clicked along with the o button.So I press the O key my up arrow key also gets pressed together its very frustrating you don't know how hard it was for me to type all the above text. I tried cleaning the keyboard after removing both the up arrow and the O key, i tried switching my account in my computer but that didnt do any good either plz help me out! i cant go to apple cuz i dont live close to them!!!  Plz dont give suggestions like go to a technician!!  Thx a bunch 

    Press F10 or press and hold the Alt key down to bring up the "Menu Bar" temporarily.
    * New Old Menu: https://addons.mozilla.org/firefox/addon/new-old-menu/
    * Personal Menu (Personal Firefox Button): https://addons.mozilla.org/firefox/addon/personal-menu/

  • How can I pause a slide until the user clicks a button?

    I wish to pause a slide until the user clicks a button (which I've created out of a Smartshape). The thing is that I haven't added a click box object over the smartshape but have only set the smartshape properties to "Use as Button". If I were to add a clickbox object, I would get a "Pause project until user clicks" in the options section of the properties. However in using a smartshape as a button, I cannot find this option. I am using Captivate 6. Seems strange as I would have expected to see the same checkbox option even if I were to use a smartshape as a button but I dont. Can't someone help me and let me know if I'm missing something.
    Of course I could use a clickbox over my smartshape to achieve what I want, but I want to avoid thsi for two reason:
    I want to avoid adding another object when I dont need it.
    My smartshape is a right arrow (indicating "Begin"), and I dont want a squarish click box sitting on top of a triangle because that just shows the hand pointer even if the cursor isn't exactly over the arrow button because it enter the clickbox area.
    Thanks,
    Sean

    Select the Smart Shape button , go to Properties > Timing accordion > Pause After and set the number of seconds from the beginning of the slide for it to pause.

  • All of a sudden when i click any button or link a new window opens with an ad

    I have used Firefox for about 7 years. No issues...
    I recently installed Ghostery add on.
    The only way to describe it is:
    I go to a page..
    Click a link (or close to it) or enter or any other button/link that would take me to what I expect..
    BUT instead it opens a new tab to an advertisement site (quibids, P&G, many other random ads) - a few of them I blacklisted with BLOCKSITE (installed after the problem started happening) but several I can't because I would actually use them when I need to (ex: Vistaprint.com)
    When I go back to the original site and click the same link and click it again it works as intended.
    This happens across all sites that I am on...
    It is like there is a hidden link within the one I am clicking on.
    I have pop ups blocked in my browser but this gets around it somehow.
    Since GHOSTERY installed, some sites do not work correctly. If I click on a picture, or something that I want to expand it is as if I am doing nothing at all because it won't complete the action, the functionality is broken.
    I have white listed a couple sites but this is random and if I whitelist everything I come across then it opens me back to what I am trying to avoid..
    EXAMPLES:
    went on Heat.com, clicked the button to go to the White Hot Gear instead it opened a new tab brandonline.com
    was on LinkedIn and hit the comment button on a thread, then it opened a new tab vistaprint.com
    was on publix.com, hit the order refills button, then it opened a new tab premium-promos.net
    did a google search clicked on the link I wanted, it opened a new tab premiumgiftrewards.net
    EACH time I go back to the original site and click the same button/link/etc it takes me where expected.
    Thanks in advance for your help!

    Both Firefox and IE have the same problem. The cursor instead of being a finger when pointing to a link is still an arrow. However I can click anywhere on the page and an ad will pop up. I have eliminated all unwanted bars in Firefox, I ran Malwarebytes until it came out clean. I also have AVG which had detected a few items on it's own. But when I get into Firefox I still have exactly the same problem. Now it will not let me download Browser Safeguard. Usually after one click the pointer returns to normal for a few screens. When I try to click to download Browser Safeguard it keeps bringing up different ads or it tries to get me to upgrade Firefox or some other browser helper program which I know are all BS tactics to get me to load their junk again. PLease help I'm an engineer and pretty good with PCs but this one has me beat at least so far.

  • Problems with Flash CC user interface. Mainly I can't seem to click certain buttons and input fields on various modal windows. (eg. Scale and Rotate, Sound Properties,

    Hi there,
    I'm wondering if anyone else is experiencing issues like this. I'm basically finding that a bunch of different buttons, fields, and tabs do not respond to my clicks. This seems to be spread out throughout the application.
    I've had to work around most of this by using the tab and arrow keys to navigate around modal buttons and fields... but it is a bit of a pain.
    There are some parts of the interface that can't be accessed via tabs and arrow keys... for example the ActionScript Tab on the Sound Properties window... there's no way to get to that... and clicking the tab itself does nothing, although I can see that the rollover state of the tab is activated.
    I've ended up having to run Flash CS6 in order to set the export classes of sound files and that's a bigger pain.
    Similar UI issues exist with other things... for example the color picker (eye dropper) seems to pick colors near, but not directly under itself.
    I'll be honest... I'm running on Windows 7... via boot camp... on a Mac Book Pro with retina display... so the issues could stem from this combination. However... Flash CS6 does not have any of these issues... so I can only think that it is a Flash CC issue.
    I appreciate any input you can provide. ( Although the obvious "run it on OSX instead" or "just use CS6" aren't the kinds of answers I'm looking for. I have my reasons for the setup. )
    Thanks.
    Cheerfully,
                           - JR

    Thank you for the suggestion. I've just done the uninstall, clean, re-install process.
    No luck.
    Even the first-run modal that comes up to choose Sync Settings has the same problem. All three buttons will go to a rollover state if I mouse over them... however, none of them are clickable. The only clickable item is the OS window close button. If I use the TAB key to move from button to button it moves the yellow button selector accordingly. If I press the ENTER key it responds correctly. For some reason clicking is not working on these parts of the Flash CC UI.
    *Note: This does not happen with all of the Flash CC UI elements... only some key ones (Save As - Confirm Overwrite, Symbol Properties and Swap Symbol dialog boxes also do not work with clicks, only with the keyboard navigation). Really a pain in the posterior.
    Again, I'm wondering if this is an issue particular to my hardware/os combination but I have had no luck finding answers online.
    Any other possible solutions out there?

  • Ideas for Adding a "One Click" Print Button to VA01 Overview Screen

    I am not an ABAP developer and am doing some preliminary functional investigation to determine the best way to add a simple "one-click" button that allows a Sales Order Confirmation output to be sent to the printer.
    Can someone that really knows, tell me whether or not a custom menu item can be added to VA01 and VA02?
    I have seen lots of threads telling folks how to find user exits and menu exits for a program so I don't need that advice.  Rather, looking for someone who has already investigated this for VA01 and VA02 and knows the answer.
    Problem Statement:
    Our users would like a "quick print" button on the VA01/VA02 application toolbar that immediately spools the Order Confirmation output to the printer. Our users want to print the output on demand, i.e., they do not want the output to automatically be printed when the order is created because a printout is not always needed. We already have condition records created with Dispatch Time set to 3 - Send with application own transaction. However, it takes 7 or more clicks to print the output on demand by navigating the menu (Extras > Output > Edit...Further Data...etc.) and changing the Dispatch Time to 4 - Send immediately when saving. This is a big ergonomic issue and a time killer.
    Although the number of clicks to print are less when printing the output from the VA02 initial screen (via menu Sales document > Issue Output To), this is not acceptable when creating new orders. Really need an on-demand, "one click" quick print button on the VA01 screen. As an aside, we have a totally custom transaction for preparing sales order data (shopping cart-like way of finding materials and entering required data) that then calls VA01 and fills in all of the information. When saving in VA01, the user is returned to our Z-transaction so asking the user to subsequently run VA02 to print is not practical.
    Current Output Determination:
    We have custom output type ZBS0 (copy of BS0). Condition records for print medium are set to Dispatch Time = 3.
    Ideal Solution:
    Add a Print Icon to the application toolbar as described above.  From the button, write custom code that calls RSNAST00 (or is there a better way?) to send the output to the printer.
    Any feedback on how others have solved this problem would be greatly appreciated.
    Rob

    Still looking for input from anyone that has had experience trying to add a menu item or toolbar button to VA01.  In our case, for sending output.
    Madhu,
    Please again read my Problem Statement in my original posting for the business requirement.  We are using ECC 6.0.  Yes, I know that transaction VA02 has Sales Document > "Issue Output To" that allows you to print.  However, we want to be able to print from the VA01 Overview screen after all of the sales order information has been entered.  We would like to be able to click a print button which would save the new sales order and immediately issue the output.  Again, we do not want the output to automatically print for every new sales order - we want to be able to print only when needed.  The conditions that a sales person would use to decide to print a copy are too numerous or varied so they cannot be automated in a condition record.  Of course we do use condition records for creating the output but we do not send immediately on save.
    When creating a sales order, the sales person does not want to do the extra clicks and key strokes to then navigate or open a new VA02 session to print from the VA02 initial screen.  And as described in my original posting, it is a lot of clicks navigate the VA01 Extras > Output menu to change the output to print on save.
    If you observe the "day in the life" of a sales person and see all of the key strokes and clicking required to create an ECC 6.0 sales order, you understand why the extra 7 to 11 clicks to just print an output is very annoying.  We have created a totally custom Z-transaction that allows our sales folks to capture everything need for a new sales order all on one screen with no tab views.  We then launch VA01 to fill in all of the data entered in our custom transaction.  This all works very well and is a huge time saver for our sales staff.  Now we are looking to save a few more clicks by simplifying the printing.

  • How to avoid the "Enter Employee Responsible" error in an Opportunity

    Hi CRM gurus,
    My employer wants me to create a custom Lead Type (and an Opportunity Type) which will look just like the SAP default Lead (and Opportunity Type respectively), except that he wants a custom Partner Function called "Sales Person" instead of the two default Partner Functions "Sales Representative" and "Employee Responsible".
    So, I made a copy of the PF "Employee Responsible" and named it as "Sales Person". I made a copy of the Partner Determination Procedure for both Lead and Opportunity Transactions. Deleted the PFs "Sales Representative" and "Employee Responsible", and added the PF "Sales Person". I made a copy of the Lead and Opportunity Transaction Types, and assigned the appropriate PF Determination Procedures. I got the Access Sequence and the Partner Determination Procedure right (checked it by clicking the button "Check Part. Determ. Proc"). I did all the miscelleneous minor changes that need to be done.
    Now, when I create a Lead, and then create an Opportunity as a follow up document, and add a Product to this and try saving the Opportunity, I get an error message saying "Enter Employee Responsible".
    It seems that the PF "Employee Responsible" is a required field in the SAP default Opportunity, but how can I avoid that in my custom Opportunity?
    Even if we try to avoid this PF now, does it have any repercussions in the follow-up documents that get generated from this transaction (like Sales Quotation, Sales Order etc) or in any other way. How important is the PF "Employee Responsible", or better, what's the significance of this PF in the Opportunity transaction?
    I'll appreciate any thoughts from you. I will instantly award max points for the correct answer
    Thanks,
    -Pras

    Kai,
    Thanks for your response. I have mailed you the screen-shots of my configurations. I did not know how to pass this info via SDN, hence I mailed it directly to your e-mail ID in your profile. I am sorry if that's not the right way to approach for help.
    >>If you maintain an additional employee responsible, does it work then?
    I have set the configuration "Only Functions Assigned to procedure" for the Permitted Functions in the Partner Determination Procedure. Hence, I do not have an additional "Employee Responsible" Partner Function in my list. This is to not permit the end-user to use other Partner Functions besides the mentioned here. The client wants to make this as simple as possible without giving too many options to the end-user (sales folks).
    However, I will temporarily set this field to "All defined Partner Functions" and, enter a BP for Employee Responsible and let ytou know what I see.
    Thanks a zillion for your help.
    Thanks and regards,
    -Prashanth

  • Open system form and select a row number on matrix by click on button

    Hi experts,
    I have to open the purchase order form and select a specific row number from the matrix by clicking a button on sales order form.
    is it possible ?
    can anyone help me to achieve it?
    Thanks in advance.
    Best regards
    Andrea

    Andrea,
    To Do? Clicking on a Button on Sales Order -> Opens a PO form, and selects the row?
    In the eventhandler of a button click if the PO is not linked to SO by SAP B1 standard functionality
    step 1. call ActivateMenu ("2305") of Sbo_application , this opens the PO form
    step 2. Change the form to Find mode
    step 3. enter po number to the Item UID "8" which is the document number.
    step 4. Send enter key, or Clikc On button UID "1" which finds the PO
    step 5.read the value from SO form, from matrix "38" line where you selected
    step 6. use the code above to locate the line in PO (use # column for position numbers which UID is 0)
    at step 5, i think you should select a line from SO matrix which you would like to open.
    IN sales order, If you used PO chekcbox on logistics tab to create the PO, you can find a direct link between PO and SO (only in docentries are linked not positions) on sales order,  Column UID 158 field name: potrgnum.  If this connection is exists, you have an easy way:
    SO form, when a user clicks on COlumn 158 (po number), you can implement an eventhandler, which
    step 1.read the value from SO form, from matrix "38" line where you selected
    step 2. use the code above to locate the line in PO (use # column for position numbers which UID is 0)
    By processing theses steps, you can build up you solution.
    Regards
    János

  • HT201209 Trying to redeem a free download for a song from KLove. When I get into my acct & try to redeem it, it just keeps bringing up the "sign-in" box. When I click the button on KLove's webpage to redeem it takes me to that page but does the same thing

    Trying to redeem a free download for a song from KLove. When I get into my acct & try to redeem it, it just keeps bringing up the "sign-in" box. When I click the button on KLove's webpage to redeem it takes me to that page but does the same thing

    Get the redeem code from the KLove page:
    http://www.klove.com/music/store.aspx
    ...and enter it into the Redeem Code box in the iTunes Store.
    You will have to sign in to your iTunes account.
    It worked fine here.  If that doesn't work for you, let us know what went wrong.

Maybe you are looking for

  • File to multiple IDOC split without BPM

    Hi expert, I have a flat file to IDOC scenario. In flat file, I have thousands of rows. Each row need to create one IDOC. In IDOC, I have 3 segments(seg2 is the child of seg1, seg3 is the child of seg2). Each field in flat file will be mapped to the

  • XServer don't start

    Hello, my XServer will not start :-(. My Errormessage: "The windows system device configuration my be incomplete or incorrect. Enter root passwort to run kdmconfig, wich will update and test the windows system configuratio..." Then i start kdmconfig,

  • Merge CHAR values in BEx

    Hello Experts, I am trying to achieve the following, please can someone throw me some ideas. ofcourse points will be assigned to the useful answers. I have a Char called "Acc.*** cat" which has 3 to 5 values such as "WBS element", "Order", "Cost cent

  • How we can recover the screen resolutions on maverick

    how we can recover the screen resolutions on maverick

  • "canon mp navigator ex has stopped working" cannot get this to work - fresh install on windows 8.1

    Trying to get LiDE 110 scanner working on my laptop. I keep getting this message once scan is complete "canon mp navigator ex has stopped working" and then a corrupted pdf is saved - fresh install on windows 8.1 I have used most up to date drivers an