Java examples for Swing:JTextField
Change Font of JTextField
import java.awt.FlowLayout; import java.awt.Font; import javax.swing.JApplet; import javax.swing.JTextField; public class Main { /*w ww . jav a 2s . c om*/ public void init(){ JTextField field = new JTextField("JTextField Change Font Example",30); Font font = new Font("Courier", Font.BOLD,12); field.setFont(font); } }