本文整理了Java中javax.swing.JSpinner.addFocusListener()
方法的一些代码示例,展示了JSpinner.addFocusListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSpinner.addFocusListener()
方法的具体详情如下:
包路径:javax.swing.JSpinner
类名称:JSpinner
方法名:addFocusListener
暂无
代码示例来源:origin: triplea-game/triplea
final JSpinner scaleField = new JSpinner(new SpinnerNumberModel(0.1, 0.1, 2.0, 1));
scaleField.setValue(mapProperties.getUnitsScale());
scaleField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(final FocusEvent e) {
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-midp
private void initComponents() {
setLayout(new BorderLayout());
if (useSpinner) {
spinner = new JSpinner();
spinner.getModel().addChangeListener(this);
spinner.addFocusListener(this);
add(spinner, BorderLayout.CENTER);
spinner.getAccessibleContext().setAccessibleName(
radioButton.getAccessibleContext().getAccessibleName());
spinner.getAccessibleContext().setAccessibleDescription(
radioButton.getAccessibleContext().getAccessibleDescription());
} else {
textField = new JTextField();
textField.getDocument().addDocumentListener(this);
textField.addFocusListener(this);
add(textField, BorderLayout.CENTER);
textField.getAccessibleContext().setAccessibleName(
radioButton.getAccessibleContext().getAccessibleName());
textField.getAccessibleContext().setAccessibleDescription(
radioButton.getAccessibleContext().getAccessibleDescription());
}
}
内容来源于网络,如有侵权,请联系作者删除!