ここにコードスニペットがあります
private void viewscriptJButtonActionPerformed(ActionEvent evt){
try{
for (int j = 0; j <= i; j++) {
scriptPane.setText(queryList.get(j).toString() + "\n");
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,"error:\n"+e.getMessage().toString() + "\n" + e.getCause().toString() ,"Error",JOptionPane.ERROR_MESSAGE);
}
}
catch ブロック内のコードは常にNullPointerException
.This は単なる参照です。この問題は、例外をキャッチする必要があるときはいつでも、すべてのボタン クリック イベントで発生します。どんな助けでも。