Mapping enter and esc to ok and cancel buttons

Hi,
Does java's fine API offer any method of mapping Enter and ESC to OK and Cancel buttons in a customized JDialog?
The current way I'm doing it is through a brute force of adding a KeyListener to every component in the dialog box (in an automated way), is there another way?
Any suggestions would be appreciated.

Uh oh, should I be scared because he knows more about
Swing than just about anyone?
Yes. Because if you really get stuck then he won't help you and then you are doomed.
If anybody was rude it was him, and if anybody is an
idiot it's you. See how easy it is to make claims
without providing any reasons or rationale?Reasons and rationale have been provided but I guess you didn't grasp them the first go around so here goes.
1) You were impatient
You waited 30 minutes before whining and bumping. That is impatient. Nobody is being paid to deliver answers to you.
2) You posted in the wrong forum.
This is not the Swing forum is it? No it is not.
3) You should learn to search
If you had searched for even up to 15 minutes (and you wouldn't have needed this long) then you would have had your answer in half the time. Searching saves YOU time.
4) You were rude
When the facts (and please note the use of the word "fact" not personal opinion) above were pointed out to you then you were rude.
Finally the "you are an idiot" problem. I will give you this is the most subjective of the lot although given that you cannot dispute ANY of the above facts (although you seem to be trying and that's helping to make the case that you're quite the idiot) that's really not saying much.
However, it seems to me that if Person A wants the assistance of Person B (who is a valuable resource of information for person A and others) it does not seem wise for Person A to be rude to person B. So in the case of Person A who is rude to Person B who they are relying on as a free resource we can make the assertion that Person A is an idiot.
In case you couldn't follow that you are Person A.

Similar Messages

  • Drag drop and ProgressBar cancel button

    Hi,
    I have a class that extends CDragDropTargetFlavorHelper, during ProcessDragDropCommand I want to show a ProgressBar (the code that does this is actually in another, model only, plugin - might be significant), however, though the progress bar shows the cancel button doesn't.  Unless I delay the processing until after the drop is complete by scheduling the command - if I either process the command or schedule and process scheduled commands the cancel button doesn't show.
    Scheduling the command gives a bit of a delay to the user (even with highest priority) and also no ability to feedback 'drop failed'.  So I'd like to:
    - preferably get the cancel button to show without scheduling the command
    - know immediately when a drop has been completed and process scheduled commands.
    Thanks in advance
    Ian

    Thanks Ned,
    I have since been continuing to research this and it would seem that implementing the HitTest could be the way to go. If anyone has any experience or advice to support this I would be grateful.
    Regards
    Chris

  • No Cancel button on parameter screen / panel

    Dear All,
    I am using CR 2010. When running a report, the paramter popup screen(Enter Valuses) doesn't have a Cancel button. I cannot find where to set it up and let it display. Therefore, when user wanted to cancel, they can't do it but to enter all parameters.
    CR XI doesn't have this problem, as the prompt screen is rendered on the the web form and not a pop up prompt.
    Please advise, thanks in advance.
    Lukman

    Hi Lukman,
    Do you mean to say you're using Crystal Reports for Visual Studio 2010?
    See if this thread helps:
    CRVS2010 Beta - close parameter prompt or remove model image
    -Abhilash

  • How can I cancel an email..cancel button doesn't work

    I have a blank email open and cannot close it..cancel button doesn't work. How can I get rid of it

    Sleep/Wake button
    http://i1224.photobucket.com/albums/ee374/Diavonex/00bf6eae.jpg

  • Problem when press CANCEL button

    Hello Everyone,
    I have created the block which having the LOV and this is the mandatory field. There are two buttons placed on this block canvas "OK" and "Cancel".
    This new block is calling from main block, if user don't want to choose LOV item and he simply click on "Cancel" button then control should transfer to main block. But when user press the "Cancel" button automatically control transfers to "On-Commit" trigger.
    On cancel button i have written GO_BLOCK('BLOCK_NAME'); but it does not works.
    Please suggest the way how i can close the block.
    Regards,
    JAK

    JAK,
    It sounds like you have not terminated further processing in the form. Try adding 'RAISE Form_Trigger_Failure;' after your GO_BLOCK(); call. This should ensure no further processing is done after you navigate to the specified block.
    Hope this helps.
    Craig...

  • Cancel Button - Clear Input Values

    Hello,
    I have an input form and user can click the cancel button. When user returns later, I want emty input fields.
    But my code, does not work:
    public String cancelDugme_action() {
           DCBindingContainer dcBindings = (DCBindingContainer)getBindings();
           AttributeBinding id = (AttributeBinding)dcBindings.getControlBinding("idKorisnika");
           id.setInputValue(null);
           return "nazad";
    }I get null pointer exception...
    Why?
    Thanx
    Vanja

    Hi,
    Please find the explanation for the immediate property for a button found in the IDE Help section.
    If this property is selected, when the user activates the button, the code in the page bean is executed before the validation, updating of model values, and so on. Essentially, code execution happens right away on the server, which then returns the page.
    The most common example of an immediate action is a Cancel button. You make it immediate so that the normal validation and update steps can be skipped, but the action handler can still do whatever is necessary. Typically, the action handler will navigate back to some previous page. In some designs the action handler might also enqueue an informational message like "Transaction cancelled". It is possible to do more: for example, an application might record the fact that the user got partially through a form and then cancelled it.
    Setting immediate property to false for the submit button makes the application behave as one could expect.On reading this it appears that the immediate property on the Submit button was set to true along with the Cancel button. Please ensure that the immediate property is only set when the code in the page bean is to be executed bypassing the normal cycle.
    Hope this helps
    Cheers
    Giri

  • Problem with cancel button in UIX

    I have a ADF UIX page(J Dev 10g Ver 1012) in which I have used a submit button as a Cancel button in case the user does not want to submit the record. For the cancel button I have set the property "unvalidated=true" and redirected it to a rollback action. Problem is when I create a record and then click on the cancel button it gives an error "value is required" for all the fields which are mandatory (but does not give validation errors). If however I type something into the mandatory fields it works fine. Is there a way to use cancel without forcing the user to type something when he does not want to do so.

    Does that help?
    ADF UIX cancel/rollback button?
    Sascha

  • Processing Page with cancel button.

    Hi,
    I have implement Processing Page but client wants to have cancel button to cancel the process.
    Can anyone give suggestions how to implement this?
    SC

    My requirement is that i have a custom base page with submit button. When user clicks on submit button it would start long running process
    And I should show a dialog page with clock saying process in progress message and a cancel button. User should be able to stop the process by clicking cancel button and back to base page. OAF gives the processing page that i want but without cancel button.
    I try to add cancel button on the processing page programmatically but while it is processing and when i click on cancel button i cannot capture the event.
    how to add cancel button on it and capture event? Is this correct approach?
    Can any body could suggest the best approach and solution?
    Thanks
    SC

  • When I enter time machine (on Time Capsule) i see the stack of screen shots and the time line. However, when I roll over the mouse pointer, the time line does not activate. The cancel button does not get me out of the app: have to alt cmd esc. Ideas?

    When I enter time machine (on Time Capsule) i see the stack of screen shots and the time line. However, when I roll over the mouse pointer, the time line does not activate. The cancel button does not get me out of the app: have to alt+cmd+esc. Ideas?

    I have never seen it but then I run SL which is much more reliable than Lion..
    See
    http://pondini.org/TM/E4.html
    Check the master guru of all TM problems.

  • I entered time machine and wish to exit but the cancel button has no effect and neither does command quit.  I have no access to the Apple toolbar to use force quit.  How do I get out of this thing?????

    I opened the backup window of my time machine.  I now wish to exit.  The cancel button and Command quit have no effect.  Turning off the IMac and disconnecting the time machine have no effect. I have no access to the normal tool bar. I want outa here.  Help!

    As always.. pondini to the rescue..
    http://pondini.org/TM/D6.html
    (I got there via google search.. took less time than to type this reply).

  • How to handle the "cancel" button and "close" icon of a popup ?

    Hi,
    I have a popup with "cancel button" and "close icon"(on the top right corner of the popup), I want the same operations to be performed on clicking of any of these two components.
    Is there a way to handle such situation ?
    I read about 2 cases to look into this but they didn't work too well for me.
    1. I read about the "popcancellistener" but that listener is called whenever the popup closes, so suppose I have an "ok button" on the popup to create a record, after the record is created, the popup closes and goes into the "popcancellistener", now the question is "how do we know if it came there because of the 'ok button' or 'some other event'".
    2. I even checked the "DialogListener", now I'm able to distinguish between the 'OK' and 'CANCEL' button in the dialoglistener using the "Dialog.Outcome.ok/cancel", but when a user clicks on the close icon, we do not enter the "DialogListener" at all, so in this case "how do we handle the close icon click event"
    Do let me know if you need any more information from my side.
    Thanks for the help in advance.

    The following mechanism responds to any of the following events: <Esc> key, Close icon ('x'), Cancel button
    JavaScript part:
    function popupClosedListener(event){
                  var source = event.getSource();
                  var popupId = source.getClientId();
                  var params = {};
                  params['popupId'] = popupId;
                  var type = "serverPopupClosed";
                  var immediate = true;
                  AdfCustomEvent.queue(source, type, params, immediate);
    }JSF part:
             <af:popup ....>
                  <af:clientListener method="popupClosedListener"
                                           type="popupClosed"/>
                  <af:serverListener type="serverPopupClosed"
                                          method="#{myBean.serverPopupClosedMetod}"/>
            </af:popup>Finally, Java part:
    public void serverPopupClosedMetod(ClientEvent event){
    }

  • Popup- ok and cancel button

    Hello,
    The popup 'X' has nested view 'Y' and Ok, Cancel buttons. Nested View 'Y' has a start point, a Data service, a table with single column 'Z' and a out-port (configured to event Select), from the out-port, close pop-up endpoint is connected which is mapped to store the value of column 'Z'.  The value of column Z, should be send out only on the click of OK button of the pop-up and not when Cancel is clicked, is there a way to validate that? At this moment, it is sent regardless of which button is clicked.
    Thanks much,
    Dharmi

    Hi Kobi,
    I understood what you said but how do you do "that can be set to TRUE in the popup OK button." ?? The popup at [design time|http://img145.imageshack.us/img145/8789/popupdesigntimeks2.jpg] and [layout|http://img371.imageshack.us/img371/750/popuplayoutgs4.jpg].
    If it is a normal form which has button you can store anything with that to data store, here how would I link that "OK" (close window) action of popup?
    Best regards,
    Dharmi

  • Reg: save exit and cancel buttons

    Hi,
    In normal report programs when we enable the back , exit and cancel buttons they work fine without writing any code.but its not in the case of Module pool why?
    In thr normal reports where does the code come from?
    regards
    prasanth

    Hi....
    Module pool programs is nothing but screen flow + reports...
    Here we designing the screens....
    So we hav to to give every functionality.. for all buttons and menu items of the appeared screen...
    Where as in reports...,
    We are just using the standard screen (sellection screen and list output screen ) s mostly...,
    Here also some times we hav to go for created screens.. nothing but.... interactive reports...,
    There we need to give again all those functionalities...
    And..,
    To see the BACK button logic and other logics in the reports...,
    Ex: PAI event of SAPLWBABAP program..., 
    You can find that name with...
    By giving /H and enter before ur action...
    Thanks,
    Naveen.I

  • How to enter BIOS at my P7010 and another problem

    I have a Portege 7010 CT. What is the keyboard key to enter in bios? Cause I tried F1 F2 ecc but when I start my pc pushing the button it doesnt work .
    Second problem: I ask u this thing cause I had a problem. I installed Virtual Cd 7 and I created a virtual cd (d:) when I start my pc a white text appears: no starter disk insert disk and push a button. What can I do thanx

    Hi,
    for entering BIOS you have to press ESC directly after pressing power button!
    I have no experience with virtual CD but I use a tool called Daemon tools. With this tool you can use a hdd based CD image as normal CD during Windows!
    Try it you will find it at google
    Tanya

  • I have my username, password, and sync key but I cannot click the next button to complete the sync setup?! Neither the next button nor the cancel button press?!

    I try to setup my sync account with Ubuntu 13.10 and I am able to enter my user name and password and recovery key but the next button will not click and neither will the cancel button. Only the back button, sync options button, and the x at the top of the screen are functioning?

    Did you enable the Side Bar?
    Select "Show Side Bar" from the "View" menu of iTunes.

Maybe you are looking for

  • How can I link to my website home page other than by referring to it via /index.html.

    Hi, I understand that it's better if the home page links within my site resolve to my domain name rather than to domain name and the suffix /index.html. This can be achieved by specifying an absolute URL, but is there a better alternative method? Adv

  • How do I play an audio clip embedded in a PDF file in Acrobat DC for iOS?

    It looks like playing audio clips from PDF files is currently not available on Acrobat DC for iOS, could this be enabled? Also it would be nice to be able to pause/restart/stop audio playback, see audio clip length and progress bar and jump to the de

  • Archive logs are being shipped, but are not applied

    Hi everyone, Some strange things are happening when I try to configure an Oracle Data Guard setup. Currently I am at the point where the configuration has been completed, and I just need to sync the standby database to the primary one. I can see in t

  • Field selection from differant tables

    hello all,          i need to select differant fields from differant tables when i select common fields from both the tables, is it necessary that the common field need to be a primary key in both tables. thanks in advance seenu

  • Python Import

    I seem to be having a rather annoying import issue with python. I am programming a small game using pygame, I'm almost complete with it, but have become rather annoyed that my source code for it is rather ugly and unordered. I wanted to be able to re