C++ doesn't have anything related to UI or widgetry built in... it's just a language. Nothing more.
To do anything like this you need to use a library. There are crossplatform libraries available, such as wxWidgets (my personal fav), GTK, QT, and others. Or you can opt for platform specific APIs, like WinAPI.
I'm not familiar enough with Java to know exactly what JOptionPane is, so I can't recommend something that's on point. Sorry.