Java examples for Swing:JTextField
Set JTextField Border
import java.awt.Color; import java.awt.FlowLayout; import javax.swing.BorderFactory; import javax.swing.JApplet; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.border.Border; public class Main { /* www. j a va 2s . com*/ public void init(){ JTextField field = new JTextField("JTextField Border Example",20); Border border = BorderFactory.createLineBorder(Color.red); field.setBorder(border); } }