Đang chuẩn bị liên kết để tải về tài liệu:
Lecture An introduction to Object-Oriented Programming with Java - Chapter 7: Event-driven programming and basic GUI objects
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Event-driven programming and basic GUI objects: Define a subclass of the JFrame class, using inheritance; write graphical user interface (GUI) application programs using JButton, JLabel, ImageIcon, JTextField, and JTextArea objects from the javax.swing package;. | Chapter 7 Event-Driven Programming and Basic GUI Objects Chapter 7 Objectives After you have read and studied this chapter, you should be able to Define a subclass of the JFrame class, using inheritance. Write graphical user interface (GUI) application programs using JButton, JLabel, ImageIcon, JTextField, and JTextArea objects from the javax.swing package. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Objectives After you have read and studied this chapter, you should be able to Write GUI application programs with menus, using menu objects from the javax.swing package. Write event-driven programs, using Java’s delegation-based event model. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction This chapter covers the graphical user interface (GUI). In Java, GUI-based programs are implemented by using classes from the javax.swing and java.awt packages. The Swing classes provide greater compatibility across different operating systems. They are fully implemented in Java, and behave the same on different operating systems. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Fig. 7.1 Various GUI objects from the javax.swing package. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction AWT classes are implemented by using the native GUI objects. Swing classes support many new functionalities not supported by AWT counterparts. Do not mix the counterparts in the same program because of their differences in implementation. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction To build an effective GUI using objects from the Swing and AWT packages, we must learn a new style of program control called event-driven programming. An event occurs when the user interacts with a GUI object. In event-driven programs, we program objects to respond to these events by defining event-handling . | Chapter 7 Event-Driven Programming and Basic GUI Objects Chapter 7 Objectives After you have read and studied this chapter, you should be able to Define a subclass of the JFrame class, using inheritance. Write graphical user interface (GUI) application programs using JButton, JLabel, ImageIcon, JTextField, and JTextArea objects from the javax.swing package. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Objectives After you have read and studied this chapter, you should be able to Write GUI application programs with menus, using menu objects from the javax.swing package. Write event-driven programs, using Java’s delegation-based event model. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction This chapter covers the graphical user interface (GUI). In Java, GUI-based programs are implemented by using classes from the javax.swing and java.awt packages. The Swing classes provide greater compatibility .