Netbeans 找不到 JavaFX 应用程序类

问题描述

我试图在 netbeans 中运行我的 Java 类中的一些代码片段,而 netbeans 似乎始终无法识别应用程序类(无论代码片段如何),并且每当我尝试时都会抛出一个空的 Browse JavaFX Application Classes 窗口构建或运行应用程序。

这是我目前正在尝试运行的代码:

package examplereaderusingfilereader;

import java.io.Reader;
import java.io.FileReader;

public class ExampleReaderUsingFileReader {
    public static void main(String[] args) {
    //creates an array of character
    char[] array = new char[100];
    try {
        //creates a reader using the FileReader
        Reader input = new FileReader("input.txt");
        //checks if reader is ready
        System.out.println("Is there data in the stream? " + input.ready());
        //Reads characters
        input.read(array);
        System.out.println("Data in the stream");
        System.out.println(array);
        //closes the reader
        input.close();
    } catch(Exception e) {
        e.getStackTrace();
        }
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)