-2

Java is a platform independent language. If i write a code using swing library in Java on one platform, i can use it on any platform. I know java doesn't communicate with the hardware graphics or drivers directly or else there would be a patch for every JRE related to each graphics card family. Does it use different library for different platform? (Xlib for Linux, etc.) Or something like Qt which is too platform independent?

Aniruddha Sarkar
  • 1,903
  • 2
  • 14
  • 15
  • 1
    Have you tried looking at the OpenJDK source code to figure this out for yourself? – Stephen C Jan 11 '16 at 10:59
  • 1
    Platform depended part of Swing is only the window management. Painting and interaction of components is provided by the [Look&Feel concept](https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html). – Sergiy Medvynskyy Jan 11 '16 at 11:02
  • 1
    Possible duplicate of [How java swing draws to screen from different operating systems?](http://stackoverflow.com/questions/29440313/how-java-swing-draws-to-screen-from-different-operating-systems) – Catalina Island Jan 11 '16 at 11:34
  • 1
    It is OS dependent, Swing is capable of using DirectX and OpenGL and the platforms which support it – MadProgrammer Jan 11 '16 at 20:13

1 Answers1