Java JTextField checkJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName, ArrayList errors)

Here you can find the source of checkJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName, ArrayList errors)

Description

check J Text Field Not Empty

License

Open Source License

Declaration

public static void checkJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName,
            ArrayList<String> errors) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    public static void checkJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName,
            ArrayList<String> errors) {
        if (!isJTextFieldNotEmpty(field))
            errors.add(promptName.getText());
    }//w  w w. jav  a2s.co  m

    public static boolean isJTextFieldNotEmpty(javax.swing.JTextField field) {
        return !(field.getText().trim().isEmpty());
    }
}

Related

  1. applyDefaultProperties(final JTextField comp)
  2. AreAllTextFieldsFilled(javax.swing.JTextField[] tfs)
  3. badField(JTextField field)
  4. bindPropertyChangeListener(final JTextField field, final String name, final PropertyChangeListener listener)
  5. browseFileForField(JTextField textField, JFileChooser fileChooser, Component parent)
  6. cleanTextFields(JTextField... textFields)
  7. createBrowseButton(final JTextField txtInput, final Window parent, final boolean directoryBrowser)
  8. createFieldWithLabel(String label, JTextField textField)
  9. createOutputPanel(JLabel outputFileNameLabel, JButton chooseOutputFileButton, JTextField outputFileTextField, String borderTitle)