当前位置:网站首页>AWT introduction
AWT introduction
2022-07-04 05:53:00 【Gentle ~】
Recommended reading :Java Detailed explanation of graphical interface (AWT、Swing) special column
List of articles
summary
Java Use AWT and Swing Related classes can complete graphical interface programming , among AWT The full name of is abstract window toolset (Abstract Window Toolkit), It is sun The company first provided GUI library , This GUI The library provides some basic functions , But this GUI The function of the library is relatively limited , So later sun The company also provides Swing library . By using AWT and Swing Graphical interface component library provided ,java The graphical interface programming of is very simple , The program only needs to create the required graphic components in turn , And organize these components together in an appropriate way , You can develop a very beautiful user interface .
When JDK 1.0 When it was released , Sun Provides A basic set of GUI Class library , This GUI Class libraries hope to run on all platforms , This basic library is called " Abstract window toolset CAbstract Window Toolkit )", It's for Java The application provides basic graphical components . AWT It's the window frame , It extracts common components from window systems on different platforms , When the program is running , Delegate the creation and actions of these components to the running platform of the program . In short , When using AWT Writing GUI applications when , The program only specifies the location and behavior of interface components , It doesn't provide a real implementation ,JVM Call the operating system local graphical interface to create and platform Consistent counterparts .
Use AWT The created GUI application has the same interface style as the running platform , For example Windows On the operating system , It shows Windows style ; stay UNIX On the operating system , It shows UNIX style . Sun I hope to achieve this in this way " Write Once, Run Anywhere " The goal of .
AWT Inheritance system
All and AWT All programming related classes are placed in the java.awt In the package and its subpackages , AWT There are two base classes in programming :Component and MenuComponent.
Component: Represents one that can be displayed graphically , And can interact with users , for example Button Represents a button ,TextField representative A text box, etc ;
MenuComponent: It represents the menu component of the graphical interface , Include MenuBar ( Menu bar )、 Menultem ( A menu item ) Equal subclass ;

among Container It's a special kind Component, It represents a container , Can hold ordinary Component.
AWT There is also a very important interface called LayoutManager , If there are multiple components in a container , Then the container needs to use LayoutManager To manage the layout of these components .

Recommended reading :Java Detailed explanation of graphical interface (AWT、Swing) special column
边栏推荐
- Online shrimp music will be closed in January next year. Netizens call No
- BUU-Pwn-test_ your_ nc
- js arguments参数使用和详解
- Sword finger offer II 038 Daily temperature
- JS how to convert seconds into hours, minutes and seconds display
- Steady! Huawei micro certification Huawei cloud computing service practice is stable!
- 509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
- Penetration tool - sqlmap
- What are the reasons for the frequent high CPU of ECS?
- A little understanding of GSLB (global server load balance) technology
猜你喜欢
随机推荐
js如何将秒转换成时分秒显示
JS get the attribute values nested in the object
QT 获取随机颜色值设置label背景色 代码
ES6 模块化
724. Find the central subscript of the array
[Excel] 数据透视图
LC weekly 300
JS how to convert seconds into hours, minutes and seconds display
AWT常用组件、FileDialog文件选择框
Impact relay jc-7/11/dc110v
19.Frambuffer应用编程
如何判断数组中是否含有某个元素
Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
Canoe panel learning video
Introduction To AMBA 简单理解
px em rem的区别
fastjson
FreeRTOS 中 RISC-V-Qemu-virt_GCC 的 锁机制 分析
接地继电器DD-1/60
Install pytoch geometric









