I have a query on handling error conditions with Java Swing.
I am using Netbeans to develop a simple Java Swing app. It is to load in a text file, then run calculati
yeah the problem is with your IO reading concept the while loop is reading to the end of the file and so on.. to prevent that u can use a buffered reader and use this code
String line = null
while((line = reader.readLine())!= null) {
// do stuf
}
if you are having this problem with processing the read line all you need is to create a exception class of your own by extending Exception class and throw that exception in your catch block after setting the message to your custom exception class you can set that message in to
JOptionPane.showMessageDialog(null,"message here"); //showMessageDialog is a static method
ok