To fix this problem
Step 1- Download and Install this Windows X Server https://sourceforge.net/projects/vcxsrv/
Step 2- Open XLaunch
Step 3- Select " Full screen " option
Step 4- Choose " Start no client " option
Step 5- Simply do next and finish
Step 6- Open terminal and type :
export DISPLAY=0:0                                 
gedit filename
In case your Linux machine is available with host name = 'hostname' and you'd want to ssh into the hostname and then open gedit then execute the following commands:
- Enable X11Forwardingin the ssh server
[hostname] $ vim /etc/ssh/sshd_config
             # and set X11Forwarding to yes
             X11Forwarding yes
- Set the DISPLAYenv in the client terminal and then ssl with-Xflag
export DISPLAY=0:0
ssh -X yourusername@hostname
                                 
[hostname] $ gedit filename