A Frame is the top-level container of an AWT program. In the above figure, there are three containers: a Frame and two Panels. A container can also hold sub-containers. Container: Containers, such as Frame and Panel, are used to hold components in a specific layout (such as FlowLayout or GridLayout). They are also called widgets, controls in other graphics systems. Component ( Widget, Control): Components are elementary GUI entities, such as Button, Label, and TextField.Event Listener Adapter classes, such as MouseAdapter, KeyAdapter, and WindowAdapter.ĪWT provides a platform-independent and device-independent interface to develop graphic programs that runs on all platforms, including Windows, macOS, and Unixes.Event Listener Interfaces, such as ActionListener, MouseListener, MouseMotionListener, KeyListener and WindowListener,.Event classes, such as ActionEvent, MouseEvent, KeyEvent and WindowEvent,.Custom graphics classes, such as Graphics, Color and Font.Layout managers, such as FlowLayout, BorderLayout and GridLayout.GUI Container classes, such as Frame and Panel.GUI Component classes, such as Button, TextField, and Label.The java.awt package contains the core AWT graphics classes:.Fortunately, only 2 packages - java.awt and - are commonly-used. AWT PackagesĪWT is huge! It consists of 12 packages of 370 classes (Swing is even bigger, with 18 packages of 737 classes as of JDK 8). I shall start with the AWT before moving into Swing to give you a complete picture of Java Graphics. For advanced 2D graphics programming, read "Java 2D Tutorial". The best online reference for Graphics programming is the "Swing Tutorial". You need to refer to the "JDK API documentation" for the AWT/Swing APIs (under module sktop) while reading this chapter. Furthermore, developers have moved to use technologies such as HTML5 as the basis of webapps. Other than AWT/Swing/JavaFX graphics APIs provided in JDK, other organizations/vendors have also provided graphics APIs that work with Java, such as Eclipse's Standard Widget Toolkit (SWT) (used in Eclipse), Google Web Toolkit (GWT) (used in Android), 3D Graphics API such as Java bindings for OpenGL (JOGL), Java3D, and etc. JavaFX was moved out from the JDK in JDK 11, but still available as a separate module.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |