Java examples for Swing:JTextField
Set Background Color of JTextField
import java.awt.Color; import java.awt.FlowLayout; import javax.swing.JApplet; import javax.swing.JTextField; public class Main { public void init(){ JTextField field = new JTextField("JTextField Background Color Example",20); Color color = Color.GRAY; field.setBackground(color); }/*from www. j a v a 2 s . c om*/ }