简体   繁体   中英

java AWT native OS library?

As we know AWT classes uses native OS libraries for creating GUIs but Swing uses Java library itself for creating the GUI.Can anyone please give me an example of the Windows OS library corresponds to a AWT GUI ?

Thx

In theory it may depend on jvm implementation. But in windows it use WinAPI probably.

If you need to know the really small details of how it's implemented in a low-level, download the jdk source (OpenJDK is FLOSS), and read the code yourself.
Don't expect anyone except developers who were directly related to that code to know the exact answer to your question.

The short answer is the MFC (Microsoft Foundation Classes) which all of Windows widgets are based on.

If you recall the great MS and Java Lawsuit the reason MS "Split" with how Java was developing was the MFC--at that point, Sun was considering a "JFC" which more or less later became Swing. they didn't want to re-invent something they already have. regardless, Swing is based on AWT which is heavily based on Motif/X which if I remember right is also what MS based their MFC on... It not the jvm that determines how a particular Java Swing/AWT element--like a button, but the Native Peer for that platform, which is bound to Java via the JNI....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM