Results 1 to 5 of 5
Thread: 2 Restriction on TextField
- 03-16-2011, 05:36 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 5
- Rep Power
- 0
-
Have you tried using a JFormattedTextField? Or if it must be a JPasswordField you could always add a TextFilter to the field's Document.
- 03-16-2011, 06:27 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 5
- Rep Power
- 0
JFormatedTextField in j2me? clcd ?
Are you sure?
i tried to find someting.. but the only i found to do this is by implementing the ItemStateListener somehow.
I searched the api's but it wasn't realy clear if i could just "add a restruction" it it's constructor.
- 03-16-2011, 09:21 AM #4
No, I'm sure Fubarable responded without noticing that this was in a Java ME section of the forum.JFormatedTextField in j2me? clcd ?
It's a long time since I did any Java ME, but I think you can achieve your requirement by using TextField.NUMERIC | TextField.PASSWORD (or possibly TextField.NUMERIC + TextField.PASSWORD which, according to the documentation, should give the same result)
Unless they've fixed it (not likely, it was around for 3-4 years already when I stumbled across it) there's a bug in the implementation of setConstraints(...), so the only safe way to set the constraints is in the TextField's constructor.
db
- 03-16-2011, 09:27 AM #5
Member
- Join Date
- Feb 2011
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
JFileChooser restriction
By sehudson in forum New To JavaReplies: 2Last Post: 03-14-2011, 03:21 AM -
4 digit restriction
By GTM in forum Java AppletsReplies: 3Last Post: 12-28-2010, 02:26 AM -
Access Restriction error
By kraut in forum EclipseReplies: 0Last Post: 06-19-2010, 01:07 AM -
Access restriction: Class is not accessible due to restriction on required
By kiranblighty in forum EclipseReplies: 7Last Post: 02-19-2010, 11:03 AM -
Error: Access restriction
By livnihai in forum EclipseReplies: 1Last Post: 11-25-2009, 06:53 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks