当我为空时,我想取空值JSpinner
。但是0.0
当我调用getValue()
函数时它会返回。
public JFormattedTextField getTextField(JSpinner spinner) {
JComponent editor = spinner.getEditor();
if (editor instanceof JSpinner.DefaultEditor) {
return ((JSpinner.DefaultEditor)editor).getTextField();
} else {
return null;
}
}
这是我的方法调用:
Object a = getTextField(jValueNum).getValue();
编辑:或者有什么方法可以重载 getValue() 函数?