TAILIEUCHUNG - Introduction to Java: 5-Components

Tham khảo tài liệu 'introduction to java: 5-components', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | In this chapter Component Labels Buttons A Simple Calculator Canvas Creating Your Own 5 Component Cursor Components This chapter introduces the generic graphical widget used within the AWT package Component along with a trio of specific components Label Button and Canvas. It also covers the Cursor class new to Java . Cursor support was previously part of the Frame class. Although many objects within AWT don t subclass Component and though you will never create an instance of Component anything that provides screen-based user interaction and relies on the system for its layout will be a child of Component. As a subclass of Component each child inherits a common set of methods and an API for dealing with the different events . mouse click keyboard input that occur within your Java programs. After discussing the methods in Component classes this chapter goes into detail about two specific components Label and Button. A Label is a widget that contains descriptive text usually next to an input field. A Button is a basic mechanism that lets the user signal the desire to perform an action. You will learn about the Canvas object and how to use a Canvas to create your own component. Finally we cover the Cursor class which lets you change the cursor over a Component. Before going into the mechanics of the Component class it s necessary to say a little about the relationship between components and containers. A Container is also a component with the ability to contain other components. There are several different kinds of containers they are discussed in Chapter 6 Containers. To display a component you have to put it in a container by calling the container s add method. We often call the container that holds a component the component s parent likewise we call the components a container holds its . Certain operations are legal only if a component has a parent that is the component is in a container. Of course since containers are components containers can .

TỪ KHÓA LIÊN QUAN
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.