I have been trying to custom JFormattedTextField
to display a mask for entering an IP address.
I read javadoc, and I tried with ###.###.###.###
, but it's not valid in many cases.
I found some article for this, they use Regex to format value but they don't display a mask for entering an IP.
I want to display 3 dots in text field to display IP address. Like this:
. . .
I can input a IP Address in many cases. You can see in IPv4 configuration in Windows.
. . .
Can you help me? Thanks for reading
You could try four JFormattedTextField
in a row, each separated by a JLabel(".")
. With the dot out of the way, that might make the number format easier to get right.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With