Đang chuẩn bị liên kết để tải về tài liệu:
Java™ How to Program ( Deitel - Deitel) - Phần 19

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

Tham khảo sách 'java™ how to program ( deitel - deitel) - phần 19', 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ả | Look-and-Feel Observation 11.6 Use tool tips to add descriptive text to your GUI components. This text helps the user determine the GUI component s purpose in the user interface. Creating and Attaching label2 Icons are a popular way to enhance the look-and-feel of an application and are also commonly used to indicate functionality. For examples most of today s VCRs and DVD players use the same icon to play a tape or DVD. Several Swing components can display images. An icon is normally specified with an Icon argument to a constructor or to the component s setIcon method. An Icon is an object of any class that implements interface Icon package javax.swing . One such class is ImageIcon package javax.swing which supports several image formats including Graphics Interchange Format GIF Portable Network Graphics PNG and Joint Photographic Experts Group JPEG . File names for each of these types end with .gif .png or .jpg or .jpeg respectively. We discuss images in more detail in Chapter 21 Multimedia Applets and Applications. Line 28 declares an ImageIcon object. The file bug1.gif contains the image to load and store in the ImageIcon object. This image is included in the directory for this example on the CD that accompanies this book The ImageIcon object is assigned to Icon reference bug. Remember class ImageIcon implements interface Icon an ImageIcon is an Icon. In line 28 the expression getClass .getResource bug1.gif invokes method getClass inherited from class Object to retrieve a reference to the Class object that represents the LabelFrame class declaration. That reference is then used to invoke Class method getResource which returns the location of the image as a URL. The ImageIcon constructor uses the URL to locate the image then loads it into memory. As we discussed in Chapter 1 the JVM loads class declarations into memory using a class loader. The class loader knows where each class it loads is located on disk. Method geTResource uses the Class object s class .

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.