TAILIEUCHUNG - Introduction to Java: 6 Containers

In this chapter: • Container • Panel • Insets • Window • Frames • Dialogs • FileDialog 6 Containers This chapter covers a special type of Component called Container. A Container is a subclass of Component that can contain other components, including other containers. Container allows you to create groupings of objects on the screen. This chapter covers the methods in the Container class and its subclasses: Panel, Window, Frame, Dialog, and FileDialog. It also covers the Insets class, which provides an internal border area for the Container classes. Every container has a layout associated with it that controls how the container organizes. | In this chapter Container Panel Insets Window Frames Dialogs FileDialog 6 Containers This chapter covers a special type of Component called Container. A Container is a subclass of Component that can contain other components including other containers. Container allows you to create groupings of objects on the screen. This chapter covers the methods in the Container class and its subclasses Panel Window Frame Dialog and FileDialog. It also covers the Insets class which provides an internal border area for the Container classes. Every container has a layout associated with it that controls how the container organizes the components in it. The layouts are described in Chapter 7 Layouts. Java introduces a special Container called ScrollPane. Because of the similarities between scrolling and ScrollPane the new ScrollPane container is covered with the Scrollbar class in Chapter 11 Scrolling. Container Container is an abstract class that serves as a general purpose holder of other Component objects. The Container class holds the methods for grouping the components together laying out the components inside it and dealing with events occurring within it. Because Container is an abstract class you never see a pure Container object you only see subclasses that add specific behaviors to a generic container. 205 206 Chapter 6 Containers Container Methods Constructors The abstract Container class contains a single constructor to be called by its children. Prior to Java the constructor was package private. protected Container The constructor for Container creates a new component without a native peer. Since you no longer have a native peer you must rely on your container to provide a display area. This allows you to create containers that require fewer system resources. For example if you are creating panels purely for layout management you might consider creating a LightweightPanel class to let you assign a layout manager to a component group. Using .

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.