Developing Java Beans by Robert Englander Unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. This page was updated December 5, 2001. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification UNCONFIRMED errors and comments from readers: [38] At the bottom of page, the code seems incorrect: tempAdapter1 = new TemperatureAdapter1(); tempAdapter2 = new TemperatureAdapter2(); it seems to be: tempAdapter1 = new TemperatureAdapter1(theTemperature1); tempAdapter2 = new TemperatureAdapter2(theTemperature2); [49] adapter = new GenericButtonAdapter(this);; The comment in your errata that ExampleApplet2 will not compile is NOT correct in my version, since the GenericButtonAdapter constructor DOES throw a ClassNotFoundException. See page 47. And it compiles just fine. public GenericButtonAdapter(Object target) throws ClassNotFoundException However, I do get the following runtime error: java.lang.NoClassDefFoundError: BeansBook/util/GenericButtonAdapter at ExampleApplet2.init(ExampleApplet2.java:27) at sun.applet.AppletPanel.run(AppletPanel.java:344) at java.lang.Thread.run(Thread.java:484) Since it compiles, I don't think it is a classpath error, and I am not sure what the problem is. I am compiling the ExampleApplet2 in the Simulator directory without a package statement. I would like to know a solution, since this would be a very useful technique, if I could get it to work. {49} code, catch block; There seems to be an extraneous catch block in the init() method try block that reads: try { adapter = new GenericButtonAdapter(this); adapter.registerActionEventHandler(b1, "handleB1"); adapter.registerActionEventHandler(b1, "handleB1"); adapter.registerActionEventHandler(b1, "handleB1"); } catch (ClassNotFoundException e) { System.out.println(e); } catch (NoSuchMethodException e) { System.out.println(e); } Since the ClassNotFoundException is never thrown in GenericButtonAdapter the code will not compile. I would suggest the code should read as follows: try { adapter = new GenericButtonAdapter(this); adapter.registerActionEventHandler(b1, "handleB1"); adapter.registerActionEventHandler(b1, "handleB1"); adapter.registerActionEventHandler(b1, "handleB1"); } catch (NoSuchMethodException e) { System.out.println(e); }x [69] Code example bottom listing: The code example uses: if (evt.getSource() == theTemperature && evt.getPropertyName() == "CurrentTemperature") { .... correction, if (evt.getSource() == theTemperature && evt.getPropertyName().equals("CurrentTemperature")) { .... The first example is comparing references, not the actual values of the strings. Also, curious why all the add/remove methods are synchronized, when the vector is already sychronized. [75-76] Code Sample: This example is different from the same example code that can be downloaded from the oreilly web site. The download is missing the propertyChange method (which of course means it will not compile as it implements PropertyChangeListener). This is confusing to me as well, because it never fires the propertyChange Event, so does fireVetoableChange do that automatically? (276) last line; In the [5/00] printing it reads: java.beans.Instrospector class. It should be java.beans.Introspector class. The word Introspector is spelled incorrectly.