Comment convertir jtextfield code> à chaîne et chaîne sur
jtextfield code> en java? p>
4 Réponses :
Comment convertir jtextfield en chaîne et chaîne à JTextfield en Java P>
Si vous voulez dire comment obtenir et définir la chaîne de JTextfield, vous pouvez utiliser les méthodes suivantes: P>
jTextField.setText(str) // set string to jtextfield //or new JTextField(str) // set string to jtextfield
// to string String text = textField.getText(); // to JTextField textField.setText(text); You can also create a new text field: new JTextField(text)Note that this is not conversion. You have two objects, where one has a property of the type of the other one, and you just set/get it.Reference: javadocs of JTextField
Le jtextfield code> offre un
gettext () code> et un
settext () code> méthode - ceux-ci sont pour obtenir et définir le contenu du champ de texte . P>
J'espère que cela aide P> P> jtextfield code> nous permet de
gettext () code> et
settext () code> Ceux-ci sont utilisés pour obtenir et définir le contenu du champ de texte, pour Exemple.
embaucher un alchimiste ;-) sérieusement: convert i> n'est pas ce que vous voulez ...