I have this code which saves the value into database from JSpinner

SpinnerListModel monthModel = new SpinnerListModel();
String[] monthStrings = {"1Month","3Month","6Month","1Year"}; //get month names
             monthModel = new SpinnerListModel(monthStrings);
            JSpinner spinner = new JSpinner(monthModel);
statement.setString(28,(String)monthModel.getValue().toString().toUpperCase());

But how to get that value back for Editing?

I tried

spinner.setText((String)monthModel.getValue(),29);

But it says

The method setText(String, int) is undefined for the type JSpinner

How do I get the values from Database?again to JSpinner.

I am not very familiar with Jspinners, but here is what found during a quick browse of the API :
http://docs.oracle.com/javase/7/docs/api/javax/swing/JSpinner.html#setValue(java.lang.Object)

All in all I suggest you try the setValue(), on your spinner.

Another suggesetion would be to evalute the IDE that you are using. Some IDEs support code completion which shows you what methods are available to an object.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.