• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem on spinner

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In our code,first the spinner should be empty.when we click on spinner up arrow or down arrow then only that should show current date.

I have written following code with that ,if i open the screen that is showing the current date with that format.

Date d= new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
SpinnerDateModel model=new SpinnerDateModel(d,null, null, 0);
JSpinner s1 = new JSpinner(model);
JSpinner.DateEditor de = new JSpinner.DateEditor(s1, sdf.toPattern());
s1.setEditor(de);

with the above code i am not able to get empty spinner at first time
so i have written like that to get empty spinner
((JSpinner.DefaultEditor)s1.getEditor()).getTextField().setText("");

If i written that line i am getting empty spinner.Next if i click spinner arrows i should get current date .But i am not able to get.

Please if any one know about this.
please help me to how can i get use action for that.
I have taken changelistener also its not be help ful for me.

Thanks and Regards
K.SwarnaLatha
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic