src/main/java/com/project/emailclient/ConnectDialog.java
// Validate connection settings and close dialog.
Validate connection settings and close dialog.
Validate connection settings and close dialog .
private void actionConnect() {
        if (((String) serverTextField.getSelectedItem()).trim().length() < 1
                || usernameTextField.getText().trim().length() < 1
                || passwordField.getPassword().length < 1
                || ((String)smtpServerTextField.getSelectedItem()).trim().length() < 1) {
            JOptionPane.showMessageDialog(this,
                    "One or more settings is missing.",
                    "Missing Setting(s)", JOptionPane.ERROR_MESSAGE);
            return;
        }
        dispose();
    }
private void actionConnect ( ) { if ( ( ( String ) serverTextField . getSelectedItem ( ) ) . trim ( ) . length ( ) < 1 || usernameTextField . getText ( ) . trim ( ) . length ( ) < 1 || passwordField . getPassword ( ) . length < 1 || ( ( String ) smtpServerTextField . getSelectedItem ( ) ) . trim ( ) . length ( ) < 1 ) { JOptionPane . showMessageDialog ( this , "One or more settings is missing." , "Missing Setting(s)" , JOptionPane . ERROR_MESSAGE ) ; return ; } dispose ( ) ; }
Validate connection settings and close dialog.
Validate connection settings and close dialog .
// Close dialog.