Java JTextField Create createJTextField(Rectangle bounds)

Here you can find the source of createJTextField(Rectangle bounds)

Description

Creates a new JTextField object with the given properties.

License

Open Source License

Parameter

Parameter Description
bounds The position and dimension attributes

Return

A JTextField object

Declaration

public static JTextField createJTextField(Rectangle bounds) 

Method Source Code

//package com.java2s;

import java.awt.Font;
import java.awt.Rectangle;

import javax.swing.JTextField;

public class Main {
    /**// ww w . j a v  a2  s. c o m
     * Creates a new <code>JTextField</code> object with the given properties.
     *
     * @param bounds The position and dimension attributes
     * @return A <code>JTextField</code> object
     */
    public static JTextField createJTextField(Rectangle bounds) {
        JTextField txtField = new JTextField();
        txtField.setFont(new Font("Times New Roman", Font.PLAIN, 12));
        txtField.setBounds(bounds);
        return txtField;
    }
}

Related

  1. createJTextField(Container c, String text, int x, int y, int width)
  2. createJTextField(String name, int value, FocusListener fl)
  3. initJTextField(JTextField text, String element)
  4. initLabelComponent(final JLabel label, final JTextField textField)
  5. makeJTextField(Document d, String s, int len, Object listener)