RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting

JFormattedTextField Alphabeticals

Join Date: Aug 2007
Posts: 58
Reputation: NycNessyness is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
NycNessyness NycNessyness is offline Offline
Junior Poster in Training

Re: JFormattedTextField Alphabeticals

  #4  
May 20th, 2008
Originally Posted by Ezzaral View Post
Try adding the MaskFormatter like so
try {
    MaskFormatter formatter = new MaskFormatter("?????");
    txtMask.setFormatterFactory(new DefaultFormatterFactory(formatter));
    txtMask.setFocusLostBehavior(JFormattedTextField.COMMIT);
} catch(ParseException ex) {
    ex.printStackTrace();
}
That mask only allows up to 5 letters, so you'll have to add the others up to 25.


I tried the above code but couldn't get it to work properly. Is txtMask required or is that suppose to be the name of my JFormattedTextField? If so I'm still getting an error when I compile. How can I use my code to implement the one you posted properly. Thanks again!
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:30 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC