tailieunhanh - core java volume 1 fundamental 8th edition 2008 phần 7

Boolean isTraversable (File f) trả về nếu f là một thư mục mà người dùng có thể mở ra. Phương pháp này có thể trở về false nếu một thư mục khái niệm là một tài liệu hợp chất. Giống như tất cả các phương pháp FileView, phương pháp này có thể trở về null nghĩa là chọn tập tin cần tham khảo ý kiến | Chapter 9. User Interface Components with Swing Simpo PDF Merge and Split Unregistered Version - http Dialog Boxes 485 Boolean isTraversable File f returns if f is a directory that the user can open. This method might return false if a directory is conceptually a compound document. Like all FileView methods this method can return null to signify that the file chooser should consult the default view instead. Color Choosers As you saw in the preceding section a high-quality file chooser is an intricate user interface component that you definitely do not want to implement yourself. Many user interface toolkits provide other common dialogs to choose a date time currency value font color and so on. The benefit is twofold. Programmers can simply use a high-quality implementation rather than rolling their own. And users have a common experience for these selections. At this point Swing provides only one additional chooser the JColorChooser see Figures 9-42 through 9-44 . You use it to let users pick a color value. Like the JFileChooser class the color chooser is a component not a dialog but it contains convenience methods to create dialogs that contain a color chooser component. Here is how you show a modal dialog with a color chooser Color selectedColor parent title initialColor Alternatively you can display a modeless color chooser dialog. You supply the following A parent component The title of the dialog A flag to select either a modal or a modeless dialog A color chooser Listeners for the OK and Cancel buttons or null if you don t want a listener Figure 9-42 The Swatches pane of a color chooser Chapter 9. User Interface Components with Swing Simpo PDF Merge and Split Unregistered Version - http 486 Chapter 9 User Interface Components with Swing Figure 9-43 The HSB pane of a color chooser Figure 9-44 The RGB pane of a color chooser Here is how you make a modeless dialog that sets the background .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.