JAVA Q&A
by James Begole, Philip L. Isenhour, Clifford A. Shaffer

Listing One
1. public class Browser extends Panel {
2. String docString = null;
3. TextBean textBean = new TextBean();
4. HotJavaBrowserBean browserBean = new HotJavaBrowserBean();
5. PropertyChangeSupport changes = new PropertyChangeSupport(this);
6.
7. // Constructor creates interface and ties components of
8. // HotJavaBrowserBean together (i.e., HotJavaSystemState,
9. // HotJavaDocumentStack, and AuthenticatorBean).
10.
11. public void setDocumentString(String newString) {
12. if (!(newString.equals(docString))) {
13. textBean.setText(newString);
14. browserBean.setDocumentString(newString);
15. changes.firePropertyChange("documentString", docString,newString);
16. docString = newString;
17. }
18. }
19. public String getDocumentString() {
20. return docString;
21. }
22. }






1


