0

So, so far I have this:

static SimpleDateFormat df = new SimpleDateFormat("dd MM yyyy");
jDateChooser8 = new com.toedter.calendar.JDateChooser();

when I parse the right date let's say this one:

jDateChooser8.setDate(df.parse("24 07 1987"));

it's ok, but when I try to parse "" (empty string)

jDateChooser8.setDate(df.parse(""));

I get an exeption:

first line of error is:

java.text.ParseException: Unparseable date: ""

all I want to do is set date to "", how to do it?

VincenzoC
  • 30,117
  • 12
  • 90
  • 112
mimi87
  • 53
  • 1
  • 9

2 Answers2

2

The javadoc for parse states: "Throws: ParseException - if the beginning of the specified string cannot be parsed."

The string "" cannot be parsed, and thus a ParseException is thrown.

Brett Okken
  • 6,210
  • 1
  • 19
  • 25
1

i did what i want with seems it worked.

jDateChooser8.cleanup();
mimi87
  • 53
  • 1
  • 9