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

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

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

JSpinner.getValue介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public float getValue () {
  return ((Double)spinner.getValue()).floatValue();
}

代码示例来源:origin: libgdx/libgdx

public float getValue () {
  return ((Double)spinner.getValue()).floatValue();
}

代码示例来源:origin: libgdx/libgdx

public float getValue () {
  return ((Double)spinner.getValue()).floatValue();
}

代码示例来源:origin: libgdx/libgdx

public float getValue () {
  return ((Double)spinner.getValue()).floatValue();
}

代码示例来源:origin: libgdx/libgdx

public void showDialog () {
  JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, min, max, 0.1f));
  if (showValueDialog(spinner, description)) value = String.valueOf(((Double)spinner.getValue()).floatValue());
}

代码示例来源:origin: libgdx/libgdx

public void showDialog () {
  JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, Short.MIN_VALUE, Short.MAX_VALUE, 1));
  if (showValueDialog(spinner, description)) value = String.valueOf(spinner.getValue());
}

代码示例来源:origin: libgdx/libgdx

public void stateChanged (ChangeEvent event) {
    value.setValue((Float)valueSpinner.getValue());
  }
});

代码示例来源:origin: libgdx/libgdx

public void showDialog () {
  JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, Short.MIN_VALUE, Short.MAX_VALUE, 1));
  if (showValueDialog(spinner, description)) value = String.valueOf(spinner.getValue());
}

代码示例来源:origin: libgdx/libgdx

public void stateChanged (ChangeEvent event) {
    NumericPanel.this.value.setValue((Float)valueSpinner.getValue());
  }
});

代码示例来源:origin: libgdx/libgdx

public void stateChanged (ChangeEvent event) {
    NumericPanel.this.value.setValue((Float)valueSpinner.getValue());
  }
});

代码示例来源:origin: libgdx/libgdx

public void showDialog () {
  JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, min, max, 0.1f));
  if (showValueDialog(spinner, description)) value = String.valueOf(((Double)spinner.getValue()).floatValue());
}

代码示例来源:origin: libgdx/libgdx

public void stateChanged (ChangeEvent event) {
    value.setValue((Float)valueSpinner.getValue());
  }
});

代码示例来源:origin: bonnyfone/vectalign

public void stateChanged(ChangeEvent e) {
    try {
      double newValue = (double) ((JSpinner) e.getSource()).getValue();
      strokeSize = (float) newValue;
      reloadSvgWithProperties();
      reloadMorphing(false);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
});

代码示例来源:origin: libgdx/libgdx

private void parseArgs (String[] args) {
  float scale = 1f;
  for (int i = 0; i < args.length; i++) {
    final String param = args[i];
    final boolean more = i < args.length - 1;
    if (param.equals("-b") || param.equals("--batch")) {
      batchMode = true;
    } else if (more && (param.equals("-s") || param.equals("--scale"))) {
      scale = Float.parseFloat(args[++i]);
    } else if (more && (param.equals("-i") || param.equals("--input"))) {
      File f = new File(args[++i]);
      open(f);
      fontFileRadio.setText("");
      updateFont();
    } else if (more && (param.equals("-o") || param.equals("--output"))) {
      File f = new File(args[++i]);
      saveBm(f);
    } else {
      System.err.println("Unknown parameter: " + param);
      exit(3);
    }
  }
  fontSizeSpinner.setValue((int)(0.5f + Math.max(4, scale * ((Integer)fontSizeSpinner.getValue()))));
}

代码示例来源:origin: libgdx/libgdx

private void parseArgs (String[] args) {
  float scale = 1f;
  for (int i = 0; i < args.length; i++) {
    final String param = args[i];
    final boolean more = i < args.length - 1;
    if (param.equals("-b") || param.equals("--batch")) {
      batchMode = true;
    } else if (more && (param.equals("-s") || param.equals("--scale"))) {
      scale = Float.parseFloat(args[++i]);
    } else if (more && (param.equals("-i") || param.equals("--input"))) {
      File f = new File(args[++i]);
      open(f);
      fontFileRadio.setText("");
      updateFont();
    } else if (more && (param.equals("-o") || param.equals("--output"))) {
      File f = new File(args[++i]);
      saveBm(f);
    } else {
      System.err.println("Unknown parameter: " + param);
      exit(3);
    }
  }
  fontSizeSpinner.setValue((int)(0.5f + Math.max(4, scale * ((Integer)fontSizeSpinner.getValue()))));
}

代码示例来源:origin: libgdx/libgdx

void save (File file) throws IOException {
  HieroSettings settings = new HieroSettings();
  settings.setFontName((String)fontList.getSelectedValue());
  settings.setFontSize(((Integer)fontSizeSpinner.getValue()).intValue());
  settings.setFont2File(fontFileText.getText());
  settings.setFont2Active(fontFileRadio.isSelected());
  settings.setItalic(italicCheckBox.isSelected());
  settings.setMono(monoCheckBox.isSelected());
  settings.setGamma(((Number)gammaSpinner.getValue()).floatValue());
  settings.setPaddingTop(((Number)padTopSpinner.getValue()).intValue());
  settings.setPaddingRight(((Number)padRightSpinner.getValue()).intValue());
  settings.setPaddingBottom(((Number)padBottomSpinner.getValue()).intValue());
  settings.setPaddingLeft(((Number)padLeftSpinner.getValue()).intValue());
  settings.setPaddingAdvanceX(((Number)padAdvanceXSpinner.getValue()).intValue());
  settings.setPaddingAdvanceY(((Number)padAdvanceYSpinner.getValue()).intValue());
  settings.setGlyphPageWidth(((Number)glyphPageWidthCombo.getSelectedItem()).intValue());
  settings.setGlyphPageHeight(((Number)glyphPageHeightCombo.getSelectedItem()).intValue());

代码示例来源:origin: libgdx/libgdx

void save (File file) throws IOException {
  HieroSettings settings = new HieroSettings();
  settings.setFontName((String)fontList.getSelectedValue());
  settings.setFontSize(((Integer)fontSizeSpinner.getValue()).intValue());
  settings.setFont2File(fontFileText.getText());
  settings.setFont2Active(fontFileRadio.isSelected());
  settings.setItalic(italicCheckBox.isSelected());
  settings.setMono(monoCheckBox.isSelected());
  settings.setGamma(((Number)gammaSpinner.getValue()).floatValue());
  settings.setPaddingTop(((Number)padTopSpinner.getValue()).intValue());
  settings.setPaddingRight(((Number)padRightSpinner.getValue()).intValue());
  settings.setPaddingBottom(((Number)padBottomSpinner.getValue()).intValue());
  settings.setPaddingLeft(((Number)padLeftSpinner.getValue()).intValue());
  settings.setPaddingAdvanceX(((Number)padAdvanceXSpinner.getValue()).intValue());
  settings.setPaddingAdvanceY(((Number)padAdvanceYSpinner.getValue()).intValue());
  settings.setGlyphPageWidth(((Number)glyphPageWidthCombo.getSelectedItem()).intValue());
  settings.setGlyphPageHeight(((Number)glyphPageHeightCombo.getSelectedItem()).intValue());

代码示例来源:origin: stackoverflow.com

final JSpinner spinner = new JSpinner();
 JComponent comp = spinner.getEditor();
 JFormattedTextField field = (JFormattedTextField) comp.getComponent(0);
 DefaultFormatter formatter = (DefaultFormatter) field.getFormatter();
 formatter.setCommitsOnValidEdit(true);
 spinner.addChangeListener(new ChangeListener() {
   @Override
   public void stateChanged(ChangeEvent e) {
     LOG.info("value changed: " + spinner.getValue());
   }
 });

代码示例来源:origin: wiztools/rest-client

@Override
public boolean saveOptions() {
  IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
  options.setProperty(INDENT_KEY, String.valueOf(jcb_indentResponse.isSelected()));
  options.setProperty(SYNTAX_COLOR_REQUEST, String.valueOf(jcb_syntaxRequest.isSelected()));
  options.setProperty(SYNTAX_COLOR_RESPONSE, String.valueOf(jcb_syntaxResponse.isSelected()));
  options.setProperty(SCROLL_SPEED, String.valueOf(js_scrollSpeed.getValue()));
  ServiceLocator.getInstance(RESTViewImpl.class).setTextAreaScrollSpeed(getScrollSpeed());
  return true;
}

代码示例来源:origin: runelite/runelite

private void updateThickness(boolean save)
{
  marker.getMarker().setBorderThickness((Integer) thicknessSpinner.getValue());
  updateBorder();
  if (save)
  {
    plugin.updateConfig();
  }
}

相关文章