Skip to content

Instantly share code, notes, and snippets.

@jamezrin
Created March 19, 2016 23:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamezrin/cbaad751c1af863124d6 to your computer and use it in GitHub Desktop.
Save jamezrin/cbaad751c1af863124d6 to your computer and use it in GitHub Desktop.
Little script to fix the swing rendering issues with Java
@echo off
title Java Swing Graphical Glitch Fixer
color 02
:checkadmin
net file 1>nul 2>nul
if '%errorlevel%' == '0' (
goto ask
) else (
powershell "saps -filepath %0 -verb runas" >nul 2>&1
)
exit /b
echo.
echo Little script to fix the swing rendering issues with Java
echo.
:ask
echo.
echo Operations:
echo 1) Apply the fix
echo 2) Revert the fix
echo 3) Exit
echo.
set /p response=Operation: %=%
cls
if '%response%' == '1' (
setx /m J2D_D3D "false"
echo The fix has been applied, you can leave now
goto ask
) else if '%response%' == '2' (
setx /m J2D_D3D "true"
echo The fix has been reverted, you can leave now
goto ask
) else if '%response%' == '3' (
echo Exiting...
exit
) else (
echo This is a unvalid operation...
goto ask
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment