Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

about JTextField in java gui components - Box containing one line of text.

tf = new JTextField(n); Creates textfield n characters wide.
s = tf.getText(); Returns string in textfield.

tf.setText(s); Sets text to s.


tf.addActionListener(lst); Action listener lst will be called if enter typed.


tf.setEditable(bool); Don't allow user to edit text field used for output.


tf.setHorizontalAlignment(align); JTextField.LEFT (default), JTextField.CENTER, or JTextField.RIGHT

No comments:

Post a Comment

Archives