Results 1 to 3 of 3
- 08-21-2010, 05:55 AM #1
Member
- Join Date
- May 2010
- Posts
- 14
- Rep Power
- 0
How to create UPPERCASE formatted text field with mixed character input
I am looking for a way to instantly format text that user types to uppercase. However the input will contain non-alphabet characters such as spaces and dashes. I tried JFormattedTextField with a long "UUUUUUUUUUUUUUUU" mask, but it is not able to handle non-alphabet characters.
For example format "bp96-00826a" into "BP96-00826A".
Is there a better or an easier way to do this than a document listener?
Document listener seems a bit of an overkill to do something so conceptually simple.
Thanks in advance.
- 08-21-2010, 07:37 AM #2
Member
- Join Date
- May 2010
- Posts
- 14
- Rep Power
- 0
Actually nevermind, I couldn't figure out how to do it using DocumentListener.
I would get "Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Attempt to mutate in notification" every time I try to make the text uppercase inside the listener while the user is typing.
So I do need help, an example to be exact.
Thanks in advance!
-
Let's see your code.
edit: have you considered using a DocumentFilter instead?Last edited by Fubarable; 08-21-2010 at 11:03 AM.
Similar Threads
-
count character in text file as input file
By aNNuur in forum New To JavaReplies: 7Last Post: 03-25-2010, 04:01 PM -
Problem in reading HTML input field while uploading file
By sudipanand in forum Java ServletReplies: 1Last Post: 11-27-2008, 09:26 AM -
Regarding Text Field
By adeeb in forum AWT / SwingReplies: 1Last Post: 06-05-2008, 11:01 PM -
reading text character by character
By bugger in forum New To JavaReplies: 2Last Post: 11-09-2007, 08:54 PM -
Create entity field SEQUENCE oracle
By Marcus in forum JDBCReplies: 1Last Post: 06-27-2007, 03:31 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks