Click here to Skip to main content
15,889,879 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using NetBeans Design GUI interface. I want a jFormattedTextField to turn red on error. I don't see a way to do it.

Thanks in advance.

What I have tried:

I changed the default border for the field to Etched, and under that, I added code to turn the highlite on:
if rm[1] {setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(255, 0, 0), null));}
else
{setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(153, 153, 153), null));};

Except the stupid editor adds in the last bit from null on a second time. And since it is protected code, you can't change it.
Posted
Updated 6-Sep-18 22:43pm

1 solution

According to the documentation: BorderFactory (Java Platform SE 7 )[^], the second field is the shadow colour.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900