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