Disable key-pressing in MessageDialog

XxRoboticaXx

I have a problem with my software developped in Java. The user has to write a text in a JtextPane. When there's no time left for him to write, a pop-up appears. The only problem is : if the user is writting when the message pops up, the pop-up disappears because the key pressed validate the message.

Is there's anyway I can disable this fonction ? I use this to create the MessageDialog :

JOptionPane.showMessageDialog(null,
                new UTIL_LireFichierTXT().getText(MessageTempsImparti)
                ,new UTIL_LireFichierTXT().getText(MessageAttention),JOptionPane.WARNING_MESSAGE);

Thanks for reading.

Duncan Jones

Disabling normal application behaviour (such as manipulation of dialogs with keys) is not a great idea. It confuses a lot of users, who have been groomed to expect certain core functionality in GUIs, plus it can prove a real problem for users with disabilities, who may need to use keyboard navigation in place of a mouse.

I would suggest you consider a different method of telling the user the time is up. Perhaps a banner label appearing on the application somewhere?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PrimeFaces disable submit on pressing enter key

From Dev

How to temporarily disable aa key on the keyboard after pressing it?

From Dev

Pressing the tilde key (~) waits for a second key stroke, how do I disable this?

From Dev

Pressing the tilde key (~) waits for a second key stroke, how do I disable this? (2020 version)

From Dev

Log off after pressing 5 times Windows logo key - How to disable?

From Dev

Disable form complete by pressing 'enter'

From Dev

Adding a delay between key pressing

From Dev

exiting a loop by pressing a escape key

From Dev

Pressing enter key submit the form?

From Dev

dynamic textbox in pressing enter key

From Dev

setMnemonic() and call a method by pressing the key

From Dev

Exit a program by pressing the key q

From Dev

how to emulate pressing the Enter key

From Dev

Pygame pressing key to move a Rect

From Dev

Simulate the pressing of the "Command" key on a Mac

From Dev

How to simulate a key press by pressing a different key

From Dev

Key combination input and special key buttons pressing

From Dev

Disable key or key combination

From Dev

Abort AJAX file upload by pressing escape key

From Dev

Action when pressing return key on keyboard (iOS)

From Dev

has keypressevent a method that distinguishing pressing the key continuously

From Java

to call onChange event after pressing Enter key

From Dev

Toggle insert/navigation modes by pressing insert key?

From Dev

clear content of textarea by pressing a specific key

From Dev

How do I check if the user is pressing a key?

From Dev

Stop a infinite while loop pressing a key in Matlab

From Dev

Pressing Enter Key to Login in WPF windows.

From Dev

Jquery focus out after pressing enter key

From Dev

a custom event for pressing the 'Enter key' in C#

Related Related

  1. 1

    PrimeFaces disable submit on pressing enter key

  2. 2

    How to temporarily disable aa key on the keyboard after pressing it?

  3. 3

    Pressing the tilde key (~) waits for a second key stroke, how do I disable this?

  4. 4

    Pressing the tilde key (~) waits for a second key stroke, how do I disable this? (2020 version)

  5. 5

    Log off after pressing 5 times Windows logo key - How to disable?

  6. 6

    Disable form complete by pressing 'enter'

  7. 7

    Adding a delay between key pressing

  8. 8

    exiting a loop by pressing a escape key

  9. 9

    Pressing enter key submit the form?

  10. 10

    dynamic textbox in pressing enter key

  11. 11

    setMnemonic() and call a method by pressing the key

  12. 12

    Exit a program by pressing the key q

  13. 13

    how to emulate pressing the Enter key

  14. 14

    Pygame pressing key to move a Rect

  15. 15

    Simulate the pressing of the "Command" key on a Mac

  16. 16

    How to simulate a key press by pressing a different key

  17. 17

    Key combination input and special key buttons pressing

  18. 18

    Disable key or key combination

  19. 19

    Abort AJAX file upload by pressing escape key

  20. 20

    Action when pressing return key on keyboard (iOS)

  21. 21

    has keypressevent a method that distinguishing pressing the key continuously

  22. 22

    to call onChange event after pressing Enter key

  23. 23

    Toggle insert/navigation modes by pressing insert key?

  24. 24

    clear content of textarea by pressing a specific key

  25. 25

    How do I check if the user is pressing a key?

  26. 26

    Stop a infinite while loop pressing a key in Matlab

  27. 27

    Pressing Enter Key to Login in WPF windows.

  28. 28

    Jquery focus out after pressing enter key

  29. 29

    a custom event for pressing the 'Enter key' in C#

HotTag

Archive