java - How to stop to close the JDialog when esc key is press -


How can I stop JDialog to stop closing the Esc key. I want to keep it as it is. I have already tried to communicate. SetDefaultCloseOperation (JDialog.DO_NOTHING_ON_CLOSE); But it is not working on the ASC key

I did not know that the escape key was automatically Will close the dialogue. At least it does not work on using JDK 7 on Windows 7.

If it works on other looks and fails, then I think the LAF is using key binding.

Try to use the dummy binding:

  key to avoid key; stroke = kitreak.gate's astroke (KAVENT.VK_SSKE, 0, False); InputMap im = getRootPane () GetInputMap (JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); Im.put (escapeKeyStroke, "nothing");   

If it shows your problem, then it does not help in posting.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -