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

  • Home
  • SEARCH
  • 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 7164351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:03:40+00:00 2026-05-28T14:03:40+00:00

Apparently, I’m missing something fundamental. I’m having a problem with formatting the value of

  • 0

Apparently, I’m missing something fundamental. I’m having a problem with formatting the value of a jspinner. I’ve tried a couple different ways and keep receiving an error, didn’t keep track of them, other than it has to do with how I’m trying to grab the value from jspinner.

Here is the spinner code:

//setup date format for both spinners
SimpleDateFormat datePattern = new SimpleDateFormat("MM/dd/yyyy");
JSpinner dateFrom = new JSpinner(new SpinnerDateModel());
dateFrom.setEditor(new JSpinner.DateEditor(dateFrom, datePattern.toPattern()));
JPanel dateFromPanel = new JPanel(new GridLayout());
dateFromPanel.add(dateFrom);
dateFromPanel.setBorder(new TitledBorder("Date - From"));

Here is how I’m currently trying to get the format:

SimpleDateFormat sdfSource = new SimpleDateFormat("MM/dd/yyyy");
Date from = sdfSource.parse(dateFrom.getValue().toString());
SimpleDateFormat sdfDestination = new SimpleDateFormat("MM/dd/yyyy");           
String dosFrom = sdfDestination.format(from);

Current error:
Exception in thread “main” java.text.ParseException: Unparseable date: “Mon Oct 23 00:00:00 EDT 2006”

  • 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-05-28T14:03:41+00:00Added an answer on May 28, 2026 at 2:03 pm

    I suspect the problem is this:

    dateFrom.getValue().toString()
    

    I suspect dateFrom.getValue() is just returning a Date – which of course doesn’t have any associated format. Instead of parsing that, you should just cast it:

    Date from = (Date) dateFrom.getValue();
    

    I could be wrong, of course… but that would be my first thought.

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

Sidebar

Related Questions

Apparently I'm missing something obvious here, but would appreciate a quick example. I've got
Apparently I can't move files on different volumes using Directory.Move. I have read that
Apparently .NET 4.0 does not have the PartCreator/ExportFactory for non-SL. Which is something I
Apparently many people have run into this problem, but I have yet to be
Apparently I've done something I'm not aware of All my classes now have warnings
Apparently I don't understand something about binding ListBox controls to data. Here is a
Apparently this problem comes up fairly often, after reading Regular expression to detect semi-colon
Apparently, a lot of ORMs do something like this: query.filter(username == bob) to generate
Apparently if you run something like wth:alert('hi') from the console it just works, cross-browser.
Apparently there's a problem with the nagivateToUrl function in Flex , namely that it

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.