Đang chuẩn bị liên kết để tải về tài liệu:
Intro to Java Programming phần 9

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

Chịu trách nhiệm bố trí của các nút điều khiển ba hình ảnh. Chúng tôi tạo ra lớp bên trong để xử lý các sự kiện năm nay và bản thân chúng ta hành động như là một đăng ký | Implementing the Slide Show protected void registerMRJHandlers Register MRJ handlers for open about and quit. Insert SlideShow registerMRJHandlers Locate the SlideShow registerMRJHandlers clipping in the SlideShow folder and drag it directly below the last line of code shown above. Your code should now look like this protected void registerMRJHandlers Register MRJ handlers for open about and quit. Insert SlideShow registerMRJHandlers MRJI IMRJI new MRJI MRJApplicationUtils.registerOpenDocumentHandler IMRJI MRJApplicationUtils.registerQuitHandler IMRJI MRJApplicationUtils.registerAboutHandler IMRJI This code may look a little strange at first but it will make more sense if we examine the next code block in tandem. MRJApplicationUtils.registerAboutHandler IMRJI Inner class defining the MRJ Interface Insert SlideShow MRJI Locate the SlideShow MRJI clipping in the SlideShow folder and drag it directly below the last line of code shown above. Your code should now look like this MRJApplicationUtils.registerAboutHandler IMRJI Inner class defining the MRJ Interface Insert SlideShow MRJI Implementing the Slide Show class MRJI implements MRJOpenDocumentHandler MRJQuitHandler MRJAboutHandler This gets called by MRJ for each file folder dropped onto the application. If the file is a directory this recurses through the directory structure collecting image files. @param the file to add to the list of image files to display or the File object to recurse to look for image files to add to the list. public void handleOpenFile File file if file null if file.isDirectory String directory file.getPath if directory.endsWith directory String fileList file.list for int fileInd 0 fileInd fileList.length fileInd this.handleOpenFile new File directory fileList fileInd else String upperCaseName file.getName .toUpperCase if upperCaseName.endsWith .JPG upperCaseName.endsWith .JPEG upperCaseName.endsWith .gif files.addElement file This gets called when the application receives a Implementing the