1

プロジェクトの私のビルド フォルダーは、次の構造を持っています。

build
  |-classes
        |package
             |-HelloWorld.class
  |-resources
        |-images
              |-image.png

HelloWorld クラスには ImageIcon オブジェクトがあり、その宣言は次のようになります。

ImageIcon icon = new ImageIcon(HelloWorld.class.getResource("../../resources/images/picture.png"));

しかし、それはメソッドをスローNullPointerExceptiongetResource()ます。どこで間違いを犯したのですか?

4

0 に答える 0