Question: If I connect with Java to MySQL on my localhost server, I access instantaneously.  

But if I connect outside of the localhost, from a network PC (192.168.1.100), it is very slow (4-5 seconds).  

And, if I connect from a public IP to my MY SQL server, it is also very slow (6 seconds or more).

Answer: 
Because your computer needs time to send packets to external servers and they need time to send packets back. It's called network latency, and is not an issue with Java specifically, but a general network issue.
4 seconds on connecting could be a DNS problem and cannot be just a pure network latency.
Try starting MySQL server with "skip-name-resolve" parameter to skip resolving client's IP into hostname. Prior to that, make sure your grant tables are based on IPs and 'localhost' instead of symbolic names.