Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:17:41+00:00 2026-06-05T10:17:41+00:00

I need JFormattedTextField which will format date ("dd.MM.yy"). Code: SimpleDateFormat format= new SimpleDateFormat("dd.MM.yy"); DateFormatter

  • 0

I need JFormattedTextField which will format date ("dd.MM.yy"). Code:

SimpleDateFormat format= new SimpleDateFormat("dd.MM.yy");
DateFormatter formatter = new DateFormatter(format);
format.setLenient(false);
formatter.setAllowsInvalid(false);
formatter.setOverwriteMode(true);
JForemattedTextField inputText = new JFormattedTextField(formatter);
inputText.setValue(new Date());

The problem is: if the date is "11/06/12" for example and if I try to input 12 on month I can’t do it because when I type 1 it understands the month as 16 and doesn’t give me to input the next digit.
I need that when I type for example 12 on month position then the JFormattedTextField will check the correctness of the month only after I typed the second digit, and if it is incorrect the month will return back to previous value. How can I solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:17:44+00:00Added an answer on June 5, 2026 at 10:17 am
    • maybe better would be to use JSpinner with DateSpinnerModel

    • you can implementing InputVerifier for JFormattedTextField

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to edit format for JFormatedTextField in a Java program. NetBeans are helping
Need a way for one service on a well-known Endpoint to return strings which
Need help to convert code from asp control to input type to fetch file
Need help with deleting call log from multi numbers, using the following code i
Need some advice to use iframe for widget or not. Will some addons/plugin block
Need to add it to textview, for example, standard java-code.
Need some insight on how this works I have the following piece of code
I have a form which captures a date that the user input in a
Need to launch a new ASP.NET site on this server but need to be
need your help with PHP templating. I'm new to PHP (I'm coming from Perl+Embperl).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.