1- open your internet browser
2- type java
3- choose the first link "Download Free Java Software"
4- press download button
5- after downloading it allow access and press the install button
6- choose "Do not update browser settings"
6-a pop-up message will appear after installing it "Out-of-date Java versions Detected"
7- click the uninstall button in that way your computer will automatically uninstall the outdated version and update it in the latest version.
I am not sure how it can be done by cmd. But the other option is:
1. Go to "Control Panel"
2. Select "Programs"
3. Click on "Java"
4. Select the "Update"
5. Then click on "Update Now"
Depends on what kind of window it is, also what methods you are using for rendering
If you are using the Swing/AWT, most likley you have to "repaint()" the panel
If you are using bufferStrategy you have to "show()" the bufferStrategy.
It really depends on what kind of "window" you are making.