Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

import javax.swing.JTextField;

public class Main {
    /**
     * 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;
    }
}