You cannot do this from within a running Ubuntu operating system.
The system and the swap partition must be mounted to work at all.
So you need a live media and do it from within there.
Boot from the Ubuntu (DVD/USB) installation media.
Select Try Ubuntu without installing, on Live desktop,
Open GParted - the partitions are unmounted - resize.
Note :
It is strongly recommended to first install Windows ... and after that Ubuntu.
When you do it the other way around you have to reinstall GRUB afterwards.
The way to do this depends on the partition table setup - msdos or GPT - of the disk being used.
When you installed Ubuntu in EFI mode, it is different from when installed in legacy BIOS mode.
How exactly to do this would be another question, but here you find : all necessary instructions.
Anyway, please make sure you have a backup of everything, because partitioning operation or an accidentally wrong decision during the system installation might damage your data !