| | | | Browse by category |
Article ID: 1057
Last updated: 02 Feb, 2008
Problem
Using the paste keyboard command (Ctrl-V) makes it possible for a user to paste characters into a
Cause
The current
Action
Using the paste keyboard command (Ctrl-V) makes it possible for a user to paste characters into a
JMaskEdit
field that should not be allowed. An exception is thrown when the user presses the Enter key due to the invalid characters in the mask control.Cause
The current
JMaskEdit
-based controls do not guard against the pasting of invalid characters from the clipboard buffer into a mask field. Only characters entered directly from the keyboard are checked.Action
The following modifications to the JMaskEdit
control will allow the user to use the paste (Ctrl-V) keyboard sequence with a mask-controlled field.
Change the paste(int at, String string)
method of the JMaskEdit
class and add an additional paste method as follows:
- Find the
JMaskEdit.java
file inStudioJcom oguewavelendjfcmaskv2_0
- Change the file to look like this:
public boolean paste(int at, String string) {
for (int i=0; i - Recompile the file.
This article was:
Helpful |
Not helpful
Report an issue
Article ID: 1057
Last updated: 02 Feb, 2008
Revision: 1
Views: 7516
Posted: 16 Sep, 1998 by
Dean J.
Updated: 02 Feb, 2008 by
Dean J.
Others in this category
Powered by KBPublisher (Knowledge base software)