Date Editor empty in JSpinner

Ok, I have my JSpinner with time format running ok, but now I want to find out how to set it to empty, sometimes the time is not informed (opcional) and I want it empty.

It is like this know:

int hourOfDay = Integer.valueOf( Datas.getDataFormatada("HH") );

calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);// now

// Create a date spinner that controls the hours

SpinnerDateModel dateModel =new SpinnerDateModel(calendar.getTime(), null, null, Calendar.HOUR);

spinner.setModel(dateModel);

spinner.setFont(new java.awt.Font("Tahoma", 1, 12));

spinner.setEditor(new DateEditor(spinner,"HH:mm:ss"));

I tried this but didnt work:

((JSpinner.DefaultEditor)spinner.getEditor()).getTextField().setText("");

Message was edited by:

Franzisk

[1105 byte] By [Franziska] at [2007-11-26 19:49:09]
# 1
if the 'empty' spinner is for appearance only, set the foreground the same color as the background
Michael_Dunna at 2007-7-9 22:37:27 > top of Java-index,Desktop,Core GUI APIs...
# 2

No, I need the value empty or null. Something like that.

I just need to have something like:

public boolean isEmpty(){

return spinner.getValue()==null;

}

Franziska at 2007-7-9 22:37:27 > top of Java-index,Desktop,Core GUI APIs...