Java JTextField setModelValue(JTextField tf, String value)

Here you can find the source of setModelValue(JTextField tf, String value)

Description

set Model Value

License

Open Source License

Declaration

protected static void setModelValue(JTextField tf, String value) 

Method Source Code

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

import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Main {
    protected static void setModelValue(JTextField tf, String value) {
        if (value != null) {
            tf.setText(value);//w w  w .  j a v a2s  .co  m
        }
    }

    protected static void setModelValue(JTextArea ta, String value) {
        if (value != null) {
            ta.setText(value);
        }
    }

    protected static void setModelValue(JLabel lbl, String value) {
        if (value != null) {
            lbl.setText(value);
        }
    }
}

Related

  1. quickButtonFlip(JTextField t, JTextField a, JTextField b)
  2. readBufferedImage(JTextField out)
  3. secureTextDeletionFromTextField(JTextField textField, int length)
  4. setEnabled(JTextField textField, boolean b)
  5. setEnabled(JTextField textField, boolean enabled)
  6. setText(JTextField jField, Object pObject, Object pDefault)
  7. setupNoCommitCheckbox(final JCheckBox addLogInformationCheckBox, final JTextField commitMessage, final JCheckBox noCommitCheckBox)
  8. setupTextField(JPanel panel, JLabel label, JTextField field, long val, String toolTip)
  9. setValue(JTextField f, String value)