Example usage for javax.swing JTextField setBounds

List of usage examples for javax.swing JTextField setBounds

Introduction

In this page you can find the example usage for javax.swing JTextField setBounds.

Prototype

public void setBounds(Rectangle r) 

Source Link

Document

Moves and resizes this component to conform to the new bounding rectangle r .

Usage

From source file:Main.java

/**
 * Creates a new <code>JTextField</code> object with the given properties.
 *
 * @param bounds The position and dimension attributes
 * @return A <code>JTextField</code> object
 *///from ww w .jav a2s.c  om
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;
}