コードでファイルチューザーを使用しようとしていますが、でエラーが発生"Not an enclosing class"
し"int returnVal = fc.showOpenDialog(FileChooserDemo.this);"
ます。以下は私のコードです。ANyはそれを解決すると思いますか?
browse_button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int returnVal = fc.showOpenDialog(FileChooserDemo.this);
File file = fc.getSelectedFile();
log.append("Opening: " + file.getAbsolutePath() + "." + "\n");
String ab=file.getAbsolutePath();
System.out.println(ab);
}});
actionlistener
inmainメソッドを作成しました。