In java, JFrame is Heavy Weight Component or Light Weight Component?

后端 未结 1 1279
不知归路
不知归路 2021-01-21 00:24

I Know Swing is considered lightweight because it is fully implemented in Java, without calling the native operating system for drawing the graphical user interface components.<

相关标签:
1条回答
  • 2021-01-21 01:11

    JFrames are heavyweight, since it's impossible to create a task-view-level window in most OS without creating a "heavy" AWT window. Lightweight components can replace internal widgets with java-based stuff that doesn't require JNI calls, but windows are the special case. JFrame does let you do custom renders, though. Also, if you're using other lightweight stuff, then I suggest using JFrame as well since it makes the rendering more efficient overall than mixing light and heavy components.

    0 讨论(0)
提交回复
热议问题