Is there anyway to remove a border in a JTextField
?
txt = new JTextField();
txt.setBorder(null); // <-- this has no effect.
I would really want it to look like a JLabel
- but I still need it to be a JTextField
because I want people to be able highlight it.
JTextField textField = new JTextField();
textField.setBorder(javax.swing.BorderFactory.createEmptyBorder());
http://java.sun.com/javase/6/docs/api/javax/swing/BorderFactory.html
When setting the border to 'null', you're actually telling the look & feel to use the native border style (of the operating system) if there is one.