List of utility methods to do JTextField Create
JTextField | createJTextField(Container c, String text, int x, int y, int width) This method makes it easy (and also neat) creating a JTextField and adding it to its container class.
JTextField txt = new JTextField(text); txt.setBounds(x, y, width, 20); c.add(txt); return txt; |
JTextField | createJTextField(Rectangle bounds) Creates a new JTextField object with the given properties.
JTextField txtField = new JTextField(); txtField.setFont(new Font("Times New Roman", Font.PLAIN, 12)); txtField.setBounds(bounds); return txtField; |
JTextField | createJTextField(String name, int value, FocusListener fl) Creates a new JTextField with the given name, integer value and adds a FocusListener. JTextField jt = _createJTextField(name, fl);
jt.setText(Integer.toString(value));
return jt;
|
void | initJTextField(JTextField text, String element) Initiates the Text Field text.setText(element); |
void | initLabelComponent(final JLabel label, final JTextField textField) Initializes label with text field. label.setLabelFor(textField); label.setFocusable(false); |
JTextField | makeJTextField(Document d, String s, int len, Object listener) Factory Method to create TextFiled using specified params JTextField pf = new JTextField(DEFAULT_TEXTFIELD_WIDTH) { public void setEnabled(boolean enabled) { super.setEnabled(enabled); super.setBackground(enabled ? Color.white : SystemColor.window); }; pf.setEnabled(true); if (d != null) ... |