Java JTextField setValue(JTextField f, String value)

Here you can find the source of setValue(JTextField f, String value)

Description

For a JTextField, sets the value, validates, and repaints

License

Open Source License

Parameter

Parameter Description
f - the field to update
value a parameter

Declaration

public static void setValue(JTextField f, String value) 

Method Source Code

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

import javax.swing.JTextField;

public class Main {
    /**// ww  w .j  ava2  s .  c  om
     * For a JTextField, sets the value, validates, and repaints
     * @param f - the field to update
     * @param value
     */
    public static void setValue(JTextField f, String value) {
        f.setText(value);
        f.validate();
        f.repaint();
    }
}

Related

  1. setEnabled(JTextField textField, boolean enabled)
  2. setModelValue(JTextField tf, String value)
  3. setText(JTextField jField, Object pObject, Object pDefault)
  4. setupNoCommitCheckbox(final JCheckBox addLogInformationCheckBox, final JTextField commitMessage, final JCheckBox noCommitCheckBox)
  5. setupTextField(JPanel panel, JLabel label, JTextField field, long val, String toolTip)
  6. showFileOpenDialogAndChangePrefs(String prefName, FileNameExtensionFilter fileNameExtensionFilter, JTextField textField, Class forClass, Component parent)
  7. textAreaChangeListener(JTextField a, final ChangeListener list)
  8. toUpperCase(JTextField field)
  9. triggerTextField(JTextField textField, JCheckBox checkBox)