小编Tar*_*noi的帖子

J2SE 平台未正确设置。( NetBeans IDE 8.0.2 )

我在 NetBeans 中运行程序时收到此错误。

nt -f D:\\PMT_LandingPage jfxsa-run
D:\PMT_LandingPage\nbproject\jfx-impl.xml:3725: The following error occurred while executing this line:
D:\PMT_LandingPage\nbproject\build-impl.xml:87: The J2SE Platform is not correctly set up.
 Your active platform is: default_platform, but the corresponding property "platforms.default_platform.home" is not found in the project's properties files. 
 Either open the project in the IDE and setup the Platform with the same name or add it manually.
 For example like this:
     ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.default_platform.home" in a .properties file)
  or …
Run Code Online (Sandbox Code Playgroud)

java netbeans-8

4
推荐指数
1
解决办法
9477
查看次数

如何为 JFileChooser 添加文件过滤器

我只想选择 .xls 和 .xlsx 文件,但我无法选择任何类型的文件。任何人都可以向我建议任何代码,或者任何人都可以对我现有的代码进行更改吗?提前致谢。

    public class Convertor {
    public static void main(String[] args) {
    JFileChooser chooser = new JFileChooser();
        chooser.setCurrentDirectory(new java.io.File("."));
        chooser.setDialogTitle("choosertitle");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setAcceptAllFileFilterUsed(false);

        if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
          System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
          System.out.println("getSelectedFile() : " + chooser.getSelectedFile());
        } else {
          System.out.println("No Selection ");
        }
     }
}    
Run Code Online (Sandbox Code Playgroud)

java excel jfilechooser filechooser

1
推荐指数
1
解决办法
4014
查看次数

标签 统计

java ×2

excel ×1

filechooser ×1

jfilechooser ×1

netbeans-8 ×1