It depends on the compiler and the operating system. You can use an os-independent compiler such as QT which as gui support for *nix, MS-Windows and MAC (others I don't know about). Or you can use os-specific libraries such as win32 api function and MFC class for MS-Windows. There are libraries for *nix too but I forget what they are.
I think that is one reason why java is supposed to be platform independent. As far as I know there really are no similar c++ compilers that produce platform independent code like that. Microsoft .NET Visual Studio is headed that way but may be several years away from achieving that goal.
>>can't find any that work
you didn't look very hard. Re-read my previous post because I gave you two. You will not find a function names "paintComponent" so no point looking for it. If you want to use c++ for gui then forget what you learning in java and learn the c/c++ way to do it.