Here you can find the source of buildTxtField(JFrame frame, int x, int y, int w, int h)
private static JTextField buildTxtField(JFrame frame, int x, int y, int w, int h)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JTextField; public class Main { private static JTextField buildTxtField(JFrame frame, int x, int y, int w, int h) { //JTxt JTextField txt = new JTextField(); txt.setLayout(null);//from ww w . ja v a2 s . c o m txt.setBounds(x, y, w, h); txt.setFont(new Font("Calibri", Font.BOLD, 20)); txt.setForeground(Color.BLACK); txt.setBackground(Color.yellow); txt.setOpaque(true); txt.setLayout(null); frame.add(txt); return txt; } }