What I want to do is if the user does not input anything on the text field and press "OK "button it should throw an Exception.Is there any way to do this ?
you need to put try before you catch the exception or declare it at the beggining after the method by saying throws IOException e.g. :
public void readFile() throws IOException
//do whatever it is that you do in your method
}catch (IOException e)
System.out.println("Unknown error has occured!");
hope that helped!
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
The WEB SERVICES and JAX-RS Coursehttps://coderanch.com/t/690789/WEB-SERVICES-JAX-RS