当前位置:网站首页>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
边栏推荐
- ES6 模块化
- Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
- Tutle clock improved version
- VB. Net calls ffmpeg to simply process video (class Library-6)
- 19. Framebuffer application programming
- XII Golang others
- LC weekly 300
- The end of the Internet is rural revitalization
- APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
- 如何判断数组中是否含有某个元素
猜你喜欢
HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)
如何获取el-tree中所有节点的父节点
一键过滤选择百度网盘文件
Uninstall Google drive hard drive - you must exit the program to uninstall
[excel] PivotChart
接地继电器DD-1/60
How to configure static IP for Kali virtual machine
BUU-Reverse-easyre
Input displays the currently selected picture
JS how to convert seconds into hours, minutes and seconds display
随机推荐
Understanding of cross domain and how to solve cross domain problems
[microservice] Nacos cluster building and loading file configuration
The end of the Internet is rural revitalization
Easy change
transformer坑了多少算力
ES6 模块化
tutle时钟改进版
Experience weekly report no. 102 (July 4, 2022)
JS execution mechanism
Component、Container容器常用API详解:Frame、Panel、ScrollPane
19.Frambuffer应用编程
LC weekly 300
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
Upper computer software development - log information is stored in the database based on log4net
How to determine whether an array contains an element
js获取对象中嵌套的属性值
[openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
Invalid revision: 3.18.1-g262b901-dirty
buuctf-pwn write-ups (8)
Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC