Applied Java Patterns Stephen phần 3 pptx
... 29. } 30 . 31 . public void removeProjectItem(ProjectItem element){ 32 . projectItems.remove(element); 33 . } 34 . 35 . public void accept(ProjectVisitor v){ 36 . v.visitTask(this); 37 . } 38 . ... owner = newOwner; } 30 . 31 . public void accept(ProjectVisitor v){ 32 . v.visitDeliverable(this); 33 . } 34 . 35 . public ArrayList getProjectItems(){ 36 . return null; 37 . } 3...
Ngày tải lên: 09/08/2014, 12:22
... 30 . panel.add(relationField); 31 . } else { 32 . nameField.setText(name); 33 . relationField.setText(relationship); 34 . } 35 . return panel; 36 . } 37 . 38 . public void commitChanges() { 39 . ... Contact .java 1. import java. awt.GridLayout; 2. import java. io.Serializable; 3. import javax.swing.JComponent; 4. import javax.swing.JLabel; 5. import javax.swing.JPanel; 6. i...
Ngày tải lên: 09/08/2014, 12:22
... contacts.add(element); 30 . } 31 . } 32 . public void removeContact(Contact element) { 33 . contacts.remove(element); 34 . } 35 . 36 . public String toString() { 37 . return contacts.toString(); 38 . } 39 . } ... System.exit(0); 30 . } 31 . } 32 . } Example 2 .35 TaskEditorPanel .java 1. import java. awt.BorderLayout; 2. import javax.swing.JPanel; 3. import javax.swing.JLab...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 4 pps
... supportingDocuments; 13. } 138 32 . 33 . public void open(){ 34 . addresses = (ArrayList)FileLoader.loadData(file); 35 . } 36 . 37 . public void save(){ 38 . FileLoader.storeData(file, addresses); 39 . } 40. ... TEAM FLY PRESENTS 1 13 37. } 38 . } Example 3. 13 Task .java 1. import java. util.ArrayList; 2. import java. util.Iterator; 3. public...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 5 ppsx
... exc.getMessage()); 30 . } 31 . try { 32 . Thread.sleep(pollingInterval); 33 . } 34 . catch (InterruptedException exc){ } 35 . } 36 . } 37 . 38 . public void updateTask(Task changedTask){ 39 . try{ TEAMFLY ... wait(); 30 . } catch (InterruptedException ie){ 31 . waiting = false; 32 . } 33 . } 34 . } 35 . return (RunnableTask)tasks.remove(0); 36 . } 37 . 38 . private class...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 6 ppt
... java. awt.datatransfer, java. awt.dnd, java. awt.font, java. awt.geom, java. awt.im, java. awt.im.spi, java. awt.image, java. awt.image.renderable, java. awt.print Use: J2SE (JDK1.0, greatly expanded in JDK1.2 and 1 .3) ... package is javax.swing Other packages include javax.swing.border, javax.swing.colorchooser, javax.swing.event, javax.swing.filechooser, javax.swing.plaf, jav...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 7 docx
... 28. } 29. } 30 . 31 . public void removeProjectItem(ProjectItem element){ 32 . projectItems.remove(element); 33 . } 34 . 35 . public String toString(){ 36 . return name; 37 . } 38 . } The Task ... attendees.add(attendee); 31 . } 32 . } 33 . 34 . public void removeAttendee(Contact attendee){ 35 . attendees.remove(attendee); 36 . } 37 . 38 . public String toString(){ 39 . r...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 8 potx
... owner = newOwner; } 30 . 31 . public void accept(ProjectVisitor v){ 32 . v.visitDeliverable(this); 33 . } 34 . 35 . public ArrayList getProjectItems(){ 36 . return null; 37 . } 38 . } Example A.119 ... System.exit(0); 30 . } 31 . } 32 . } Example A.92 TaskEditorPanel .java 1. import java. awt.BorderLayout; 2. import javax.swing.JPanel; 3. import javax.swing.JLabel; 4. impo...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 9 pot
... try{ 30 . FileInputStream input = new FileInputStream(fileName); 31 . textProperties.load(input); 32 . } 33 . catch (IOException exc){ 34 . textProperties = new Properties(); 35 . } 36 . } 37 . ... getAllAddresses(){ 32 . if (addressBook == null) { 33 . open(); 34 . } 35 . return addressBook.getAllAddresses(); 36 . } 37 . 38 . public Address getAddress(String description){ 39...
Ngày tải lên: 09/08/2014, 12:22
Applied Java Patterns Stephen phần 10 ppt
... exc.getMessage()); 30 . } 31 . try{ 32 . Thread.sleep(pollingInterval); 33 . } 34 . catch (InterruptedException exc){ } 35 . } 36 . } 37 . 38 . public void updateTask(Task changedTask){ 39 . try{ 40. ... updateTask(Task task){ 31 . requester.updateTask(task); 32 . } 33 . 34 . public Task getUpdatedTask(){ 35 . return updatedTask; 36 . } 37 . 38 . public void setUpdatedTask(...
Ngày tải lên: 09/08/2014, 12:22