//For extra credit
if(name.equals(null) || lastname.equals(null))
JOptionPane.showMessageDialog(null, "Sorry, you have to enter your name to enroll into CIS 226.", "Error ", JOptionPane.ERROR_MESSAGE);
else
JOptionPane.showMessageDialog(null, "Sorry, you have to enter your name to enroll into CIS 226.", "Error ", JOptionPane.ERROR_MESSAGE);
}
you haven't seen the code i had given earlier carefully, welcome message should be in else part.
if(name.equals(null) || lastname.equals(null))
JOptionPane.showMessageDialog(null, "Sorry, you have to enter your name to enroll into CIS 226.", "Error ", JOptionPane.ERROR_MESSAGE);
else
JOptionPane.showMessageDialog(null, "Hello, " + name +(" ") +lastname+ ", \n Welcome to CIS 226." );
And please mark this thread solved , if your problem is solved