TAILIEUCHUNG - Introduction to Java:13 AWT Exceptions and Errors

Tham khảo tài liệu 'introduction to java:13 awt exceptions and errors', 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ả | 13 In this chapter AWTException IllegalComponentStateException AWTError AWT Exceptions and Errors This chapter describes AWTException IllegalComponentStateException and AWTError. AWTException is a subclass of Exception. It is not used by any of the public classes in you may however find it convenient to throw AWTException within your own code. IllegalComponentStateException is another Exception subclass which is new to Java . This exception is used when you try to do something with a Component that is not yet appropriate. AWTError is a subclass of Error that is thrown when a serious problem occurs in AWT for example the environment is unable to get the platform s Toolkit. AWTException AWTException is a generic exception that can be thrown when an exceptional condition has occurred within AWT. None of the AWT classes throw this. If you subclass any of the AWT classes you can throw an AWTException to indicate a problem. Using AWTException is slightly preferable to creating your own Exception subclass because you do not have to generate another class file. Since it is a part ofJava AWTException is guaranteed to exist on the run-time platform. If you throw an instance of AWTException like any other Exception it must be caught in a catch clause or declared in the throws clause of the method. AWTException Method Constructor public AWTException String message The sole constructor creates an AWTException with a detailed message of message. This message can be retrieved using getMessage which it inherits from Exception and which is required by the Throwable interface . If you do 466 IllegalComponentStateException 467 not want a detailed message message may be null. Throwing an AWTException An AWTException is used the same way as any other Throwable object. Here s an example if someProblem throw new AWTException Problem Encountered While Initializing IllegalComponentStateException IllegalComponentStateException is a subclass of .

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.