Recreating the Sample Using BeanBox

In order to make the simulator Beans available to BeanBox, put a copy of Simulator.jar in the jars directory of your BDK installation (you could also leave it where it is and load it into BeanBox using the LoadJar entry of the File menu). Now start BeanBox and its toolbox window will show the simulator Beans, as shown in Figure 8.4.

Our Beans in the BeanBox’s toolbox

Figure 8-4. Our Beans in the BeanBox’s toolbox

Now go ahead and add one instance of each simulator Bean to the form. Remember that Temperature is an invisible Bean, so make sure that you’ve got your BeanBox set to show invisible Beans. After you add the Beans, your form will look something like Figure 8.5. It doesn’t matter where you place the Beans. I tried to put them in the same position as they were in the SimulatorSample applet, but it really doesn’t matter where you put them.

Building the simulator in the BeanBox

Figure 8-5. Building the simulator in the BeanBox

Now we have to make the appropriate connections to wire things together. Let’s start by selecting the Temperature object. We want to connect its property change events to the Thermostat, so go to the Edit menu and select the propertyChange event. Remember that this is done by following the cascading Event menu all the way to propertyChange. Now pull the rubber-band line over to the edge of the ...

Get Developing Java Beans now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.