javax.swing.JOptionPane.getOptions()方法的使用及代码示例

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

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

JOptionPane.getOptions介绍

暂无

代码示例

代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application

private static int getReturnValue(JOptionPane optionPane) {
  Object value = optionPane.getValue();
  if (value != null && optionPane.getOptions() != null){
    value = Arrays.binarySearch(optionPane.getOptions(), value);
  }
  return (value != null) ? (Integer) value : JOptionPane.CLOSED_OPTION;
}

代码示例来源:origin: org.protege/protege-editor-core-application

private static int getReturnValue(JOptionPane optionPane) {
  Object value = optionPane.getValue();
  if (value != null && optionPane.getOptions() != null){
    value = Arrays.binarySearch(optionPane.getOptions(), value);
  }
  return (value != null) ? (Integer) value : JOptionPane.CLOSED_OPTION;
}

代码示例来源:origin: protegeproject/protege

private static int getReturnValueAsInteger(JOptionPane optionPane) {
  Object value = optionPane.getValue();
  if(value == null) {
    return JOptionPane.CLOSED_OPTION;
  }
  Object[] options = optionPane.getOptions();
  if(options == null) {
    if(value instanceof Integer) {
      return (Integer) value;
    }
    else {
      return JOptionPane.CLOSED_OPTION;
    }
  }
  for(int i = 0; i < options.length; i++) {
    Object valueAtIndex = options[i];
    if(value.equals(valueAtIndex)) {
      return i;
    }
  }
  return JOptionPane.CLOSED_OPTION;
}

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInEDT
static @Nonnull Object[] optionsOf(final @Nonnull JOptionPane optionPane) {
 Object[] result = execute(() -> optionPane.getOptions());
 return checkNotNull(result);
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

option = JOptionPane.CLOSED_OPTION;
} else {
  if (pane.getOptions() == null) {
    if (value instanceof Integer) {
      option = ((Integer) value).intValue();
    Object[] options = pane.getOptions();
    for (int i = 0, n = options.length; i < n; i++) {
      if (options[i].equals(value)) {

代码示例来源:origin: de.sciss/scisslib

public static int showDialog( JOptionPane op, Component parent, String title )
{
  final JDialog	dlg;
  final Object	value;
  final int		result;
  dlg = op.createDialog( parent, title );
  showDialog( dlg );
  value = op.getValue();
  if( value == null ) {
    result = JOptionPane.CLOSED_OPTION;
  } else {
    final Object[] options = op.getOptions();
    if( options == null ) {
      if( value instanceof Integer ) {
        result = ((Integer) value).intValue();
      } else {
        result = JOptionPane.CLOSED_OPTION;
      }
    } else {
      int i;
      for( i = 0; i < options.length; i++ ) {
        if( options[ i ].equals( value )) break;
      }
      result = i < options.length ? i : JOptionPane.CLOSED_OPTION;
    }
  }
  return result;
}

代码示例来源:origin: com.jidesoft/jide-oss

protected Object[] getButtons() {
  if (optionPane != null) {
    Object[] suppliedOptions = optionPane.getOptions();

相关文章