This is a simple code to retrieve windows username in JAVA.
public class getWindowUsername {
public static final void main( String args[] ) {
String userName = System.getProperty("user.name");
System.out.println("Window's Username: "+userName);
}
}