且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用对象输入\\输出流文件和数组列表

更新时间:2023-10-05 15:37:58

我建议把一个try / catch周围抛出异常的抓住你的方法调用

I would suggest putting a try/catch around your method call that throws the exception in the catch

catch(Exception ex){
ex.printStackTrace();
}

要找出错误是从正好来了,它可能给你的更多信息,你会得到什么。

to find out where the error is coming from exactly, it might give you more information that what you're getting.

另外,我会建议使用

JOptionPane.showMessageDialog(null, "Add more Customers?", "Continue?",JOptionPane.ERROR_MESSAGE);

之类的东西,而不是让用户键入的内容的字符,它创建了一个更友好的用户界面。

or something like that rather than getting the character of what the user typed, it creates a more user friendly interface.