|
Java example source code file (MaskFormatter.java)
The MaskFormatter.java Java example source code/* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing.text; import java.io.*; import java.text.*; import java.util.*; import javax.swing.*; /** * <code>MaskFormatter is used to format and edit strings. The behavior * of a <code>MaskFormatter is controlled by way of a String mask * that specifies the valid characters that can be contained at a particular * location in the <code>Document model. The following characters can * be specified: * * <table border=1 summary="Valid characters and their descriptions"> * <tr> * <th>Character * <th> |
* <td>Any valid number, uses Any character (Character.isLetter ). All
* lowercase letters are mapped to upper case.</td>
* </tr>
* <tr> | L | Any character (Character.isLetter ). All
* upper case letters are mapped to lower case.</td>
* </tr>
* <tr> | A | Any character or number (Character.isLetter
* or <code>Character.isDigit) |
* </tr>
* <tr>? | Any character * (<code>Character.isLetter). | * </tr> * <tr>* | Anything. | H | Any hex character (0-9, a-f or A-F). | * </table> * * <p> * Typically characters correspond to one char, but in certain languages this * is not the case. The mask is on a per character basis, and will thus * adjust to fit as many chars as are needed. * <p> * You can further restrict the characters that can be input by the * <code>setInvalidCharacters and
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.