File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes problem on spinner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem on spinner" Watch "problem on spinner" New topic
Author

problem on spinner

swarna latha
Greenhorn

Joined: Jun 22, 2007
Posts: 15
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem on spinner