javax.swing.JSpinner.addFocusListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中javax.swing.JSpinner.addFocusListener()方法的一些代码示例,展示了JSpinner.addFocusListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSpinner.addFocusListener()方法的具体详情如下:
包路径:javax.swing.JSpinner
类名称:JSpinner
方法名:addFocusListener

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());
  }
}

相关文章