I. Understand vocabulary
1. Common Words
2. java. AWT package
The Java. AWT package is a Java built-in package, which is part of the Java basic class library (jfc [Java foundation classes]) and contains the following content:
1. a rich set of interface components that are easy for users to enter;
2. Place components in several layout managers in the appropriate positions
3. Event Processing Model
4. Graphics and image tools
Use an explicit declaration statement: Import java. AWT .*;
3. My first GUI program:
Import java. AWT .*;
Public class awtdemo {
Public static void main (string ARGs []) {
New myframe ("My first GUI program", 100,100,100,100, color. Red );
}
}
Class myframe extends frame {
Myframe (string S, int X, int y, int W, int H, color ){
Super (s );
Setbackground (color );
Setlayout (null );
Setbounds (X, Y, W, H );
Setvisible (true );
}
}
Ii. architecture of the Space class in the Java. AWT package
Differences between window and panel: a panel cannot exist independently and must be placed in a window or another subclass.
2. Common AWT components