In AWT application I need to set border color of TextField.
In JTextField, I know that we do can do the following
JTextField tf = new JTextField();
tf.setBorder(BorderFactory.createLineBorder(Color.decode("#2C6791")));
But setBorder() method is not availiable in awt TextField. Is there any workaround for this problem?
The AWT TextField
does not support borders, as you've found. You could emulate a border by putting the text field inside a Panel
that's just slightly larger than the textfield and changing the background color of the panel.