Can't connect to my own minecraft server?

I made a minecraft server so me and my friend could play together, but every time I try to connect to it with localhost, it says "failed to connect to server java.net.ConnectException: Connection refused: no further information:" I did the port forwarding it is allowed in the windows firewall, I don't understand why it still isn't working?

That's odd

Depends on the ip address your using, for you you should be able to type in localhost to connect, try doing that and see if it works