Java Reference
In-Depth Information
Figure 19.7
Load the movie_bean.jar file.
We are now ready to load our Movie bean into the Bean Builder and view its
properties, which we will do in the next step.
Step 6: Load the Movie Bean into the Bean Builder
To load a bean into the Bean Builder from a JAR file, click File and then Load
Jar File from the menu of the Bean Builder window. Figure 19.7 shows the dia-
log box that appears.
Browse to the directory in which you created the movie_bean.jar file, select
it, and click the Open button. If it works successfully, you will see a new tab
named User on the Bean Builder's main window. Click the User tab, and you
will see the Movie bean as the only item on the list, as shown in Figure 19.8.
The icon for the Movie bean is empty because we did not associate an
icon with the Movie bean. However, the BeanInfo class can be used to
denote an icon for a bean, and the builder tools can use the icons in
whatever fashion they want. A JavaBean can have up to four icons
associated with it: a 32x32 bit color icon, a 16x16 bit color icon, a 32x32
bit monochrome icon, and a 16x16 bit monochrome icon.
Step 7: Using the Movie Bean in the Builder Tool
Now that the Movie bean is loaded in the Bean Builder, it is ready to be used.
Click on the Movie bean in the User tab (refer to Figure 19.8), and the mouse
pointer becomes a cross. Move the mouse down to the empty JFrame in the
lower-right window, and click the mouse again anywhere inside the window.
A Movie bean object is instantiated by the builder tool, and a small rectangle is
created to view the bean, as shown in Figure 19.9.
Search WWH ::




Custom Search