【发布时间】:2020-11-26 11:33:36
【问题描述】:
我是 Java SWT 对话框的新手,我正在尝试制作一个文件选择器。我以 Eclipse 网站的 sn-p 为例:https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet72.java
我需要知道用户选择的过滤器,我通过做一些事情来做到这一点:
int idx = dialog.getFilterIndex(); followed by String filter = dialog.getFilterNames[idx];
在 linux (ubuntu 18.04) dialog.getFilterIndex() 上,即使我选择了一个过滤器,它也会返回 -1。有什么想法吗?
谢谢
【问题讨论】:
-
看起来像 Eclipse 错误546256
-
看起来像。也许发布您的答案,以便我可以将其作为接受的答案。谢谢你。 @greg-449