Hello and thanks in advance for your time.
Trying to learn how to throw App Exceptions. Is there any way to get this exception from properties so I can pass it to a JOptionPane?
Model Resources
UserException=Subscription failed. \
Please try another email address.
ProfileException=Must Select a Profile \
UnenrollException=Unsubscription failed. \
Please contact the Webmaster.
LoginException=Login failed. \
Please contact the Webmaster.
UnknownUserException=Unknown subscriber. \
Please subscribe.
IncorrectPasswordException=Incorrect password. \
Please try to login again.
IncorrectProfileException=Profile incorrect.\
Please try choosing profile again.
LoginInfoBean.java
public String loginAction(String userName,char[] password,String profile) {
this.userName = userName;
password.toString();
this.profile=profile;
try{
if(userName!=null){
//nothing yet
}
if(password.toString()!=null){
//nothing yet
}
}catch(LoginException e){
}
ModelException.java
package model.err;
import model.ModelUtils;
public class ModelException extends Exception {
public ModelException(String messageKey) {
super(ModelUtils.getResource(messageKey));
}
}
LoginException.java
package model.err;
import model.ModelUtils;
public class ModelException extends Exception {
public ModelException(String messageKey) {
super(ModelUtils.getResource(messageKey));
}
}
LoginException.java
package model.err;
import model.ModelUtils;
public class ModelException extends Exception {
public ModelException(String messageKey) {
super(ModelUtils.getResource(messageKey));
}
}
Before I tried the netbeans won't comple the program if the login exception is not actually thrown in the body of the code.
How do I fix that one?
Thanks
Steve