javax.swing.JFileChooser.isShowing()方法的使用及代码示例

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

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

JFileChooser.isShowing介绍

暂无

代码示例

代码示例来源:origin: worstcase/gumshoe

public void actionPerformed(ActionEvent e) {
    final JFileChooser chooser = targets.getFileChooser();
    if(chooser==null || chooser.isShowing()) { return; }
    chooser.showOpenDialog(targets.getFrame());
  }
},

代码示例来源:origin: org.gephi/directory-chooser

private void updateCompletions() {
  String name = normalizeFile(getFileName());
  int slash = name.lastIndexOf(File.separatorChar);
  if (slash != -1) {
    String prefix = name.substring(0, slash + 1);
    File d = new File(prefix);
    if (d.isDirectory()) {
      File[] children = d.listFiles();
      if(children != null) {
        Vector list = buildList(name, children);
        
        if(completionPopup == null) {
          completionPopup = new FileCompletionPopup(fileChooser, filenameTextField, list);
        } else if (completionPopup.isShowing() || 
            (showPopupCompletion && fileChooser.isShowing())) {
          completionPopup.setDataList(list);
        }
        
        if(showPopupCompletion && fileChooser.isShowing() && !completionPopup.isShowing()) {
          java.awt.Point los = filenameTextField.getLocation();
          int popX = los.x;
          int popY = los.y + filenameTextField.getHeight() - 6;
          completionPopup.showPopup(filenameTextField, popX, popY);
        }
      }
    }
  }
}

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

/**
 * Returns the {@code String} representation of the given {@code Component}, which should be a {@code JFileChooser}.
 *
 * @param c the given {@code Component}.
 * @return the {@code String} representation of the given {@code JFileChooser}.
 */
@RunsInCurrentThread
@Override
@Nonnull protected String doFormat(@Nonnull Component c) {
 JFileChooser fileChooser = (JFileChooser) c;
 String format = "%s[name=%s, dialogTitle=%s, dialogType=%s, currentDirectory=%s, enabled=%b, visible=%b, showing=%b";
 return String.format(format, getRealClassName(c), quote(fileChooser.getName()),
            quote(fileChooser.getDialogTitle()), DIALOG_TYPES.get(fileChooser.getDialogType()),
            new StandardRepresentation().toStringOf(fileChooser.getCurrentDirectory()),
            fileChooser.isEnabled(),
            fileChooser.isVisible(), fileChooser.isShowing());
}

相关文章

JFileChooser类方法