Link to home
Start Free TrialLog in
Avatar of BaconAndCabbage
BaconAndCabbage

asked on

Putting a value in a JSpinner

Just a simple question....how do you insert a default value into a JSpinner?

try {
     settingsGui.spinnerPort.setValue("25");
}
catch (IllegalArgumentException iae) {
}

If i wanted to put the int value '25' in there, what would i put in? What i have above doesn't work
ASKER CERTIFIED SOLUTION
Avatar of 91mustang
91mustang

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 91mustang
91mustang

rather:

try {
     settingsGui.spinnerPort.setValue(new Integer(25));
}
catch (IllegalArgumentException iae) {
}
Avatar of CEHJ
Don't have empty catch blocks - it can (if it has not already) lead to bugs that are difficult to detect