title: How does the JVM draw buttons and other controls under Windows?
body: <p>While java programs are platform independent, the JVM itself is platform dependent. I am interested in knowing how Java draws the application GUI (buttons and text) on the screen. </p>
  
  <p>Under Windows, control <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724515(v=vs.85).aspx" rel="nofollow">objects</a> such as buttons are usually created using a window(from user32.dll) or a rectangular region(from gdi32.dll), text is drawn later to the corresponding window/region handle using the provided user32/gdi32 text draw functions. </p>
  
  <p>I tried running a simple two button Java gui application using swing and hooking the majority of create region/window and text draw functions from gdi32.dll and user32.dll, but so far, it seems the Java program is just using these native dlls for drawing the main window frame only. </p>
  
  <p>Does Java.exe uses some other dlls to draw buttons and other controls on the screen ? And if so, why is this case when there are already available native dlls for drawing ?</p>