Đang chuẩn bị liên kết để tải về tài liệu:
Lecture An introduction to computer science using java (2nd Edition): Chapter 13 - S.N. Kamin, D. Mickunas, E. Reingold

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Chapter 13 - Java AWT – Part II (Optional). In this chapter we will: discuss the use of Java in animating World Wide Web applications, show how to write Java applets, introduce Java graphical components (e.g. Textfields, Buttons, and Labels), show how Java programs can be made to react to user actions on Java graphical components, show how Java applications can be run from inside web browsers. | Chapter 13 Java AWT – Part II (Optional) Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E. Reingold Chapter Preview In this chapter we will: discuss the use of Java in animating World Wide Web applications show how to write Java applets introduce Java graphical components (e.g. Textfields, Buttons, and Labels) show how Java programs can be made to react to user actions on Java graphical components show how Java applications can be run from inside web browsers Frames A frame is a window with a title bar and a border The Frame class is a subclass of Container class Container class objects may have other components (e.g. Buttons) added to them using the add method A typical Java GUI will create and display one or more frames To make a frame visible the message setVisbible(true) must be sent to the frame Layout Managers Governs how components are arranged inside a Container object The Container method setLayout allows the programmer to specify which layout manager (e.g. FlowLayout) is desired for a particular container object The size of a Container object should be set explicitly by the programmer as well Can use pack() to set size to accommodate preferred sizes of components) Frame Example public class TwoButtons { Frame f; Button redButton, blueButton; public TwoButttons() { f = new Frame(“Two Buttons Frame”); redButton = new Button(“Red”); blueButton = new Button(“Blue”); f.setLayout(new Flowlayout()); f.add(redButton); f.add(blueButton); f.pack(); f.setVisible(true); } } UML Notation The filled diamond represents composition This shows that the class TwoButtons contains a class Frame which contains a class Buttons A good UML diagram only shows the classes and associations that are important to understanding the architecture This UML diagram does not include super classes like Component or Container Using Inheritance It is possible to use inheritance to allow TwoButtons to become a frame in its . | Chapter 13 Java AWT – Part II (Optional) Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E. Reingold Chapter Preview In this chapter we will: discuss the use of Java in animating World Wide Web applications show how to write Java applets introduce Java graphical components (e.g. Textfields, Buttons, and Labels) show how Java programs can be made to react to user actions on Java graphical components show how Java applications can be run from inside web browsers Frames A frame is a window with a title bar and a border The Frame class is a subclass of Container class Container class objects may have other components (e.g. Buttons) added to them using the add method A typical Java GUI will create and display one or more frames To make a frame visible the message setVisbible(true) must be sent to the frame Layout Managers Governs how components are arranged inside a Container object The Container method setLayout allows .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.