For those who are interested in Java Beans, setting up the BDK Bean Box can help in gaining the desired knowledge. Tutorials on the subject often call upon the Bean Box to help in carrying out projects. The Bean Box is, however, an older Java API and is no longer updated to work with newer versions of Java. Thus, using it with the current Java 1.4 reveals a bug; the absence of buttons that can be hooked up to other beans to help manipulate them. On loading the Bean Box, an error message on the command line tells us that it was unable to compile one of the buttons’ Java source files. This is because one line in the file is no longer accepted. Thus, to solve this, the source file must be changed and recompiled.
This is easier said than done. The buttons are compiled as the result of commands carried out from a Make file and stored in a Java Archive, or JAR. Thus, the Java source file must be corrected and the Make file must be run once again so that the application's corrected source file is properly compiled.To do this, you must download Microsoft’s Nmake, which is available for free. Nmake must be placed in the folder that contains the Make file. The PATH must be set to the JDK/bin so that the Java source file compiles. Then, Nmake must be executed on the Make file.
1- Enter the jdk1_1 directory; enter the beans subdirectory, to demo, to sunw, to demo and to the buttons subdirectory; bdk1_1\beans\demo\sunw\demo\buttons.
2- Select the ButtonBeanInfo.java file. Since the file is read-only, make it possible to write to it by right-clicking the file, selecting “Properties” and de-selecting the read-only box. Open it as a text file. Replace the first actionPerformed string in the first EventSetDescriptor with action. Save the file. For more information on how to change the source file, go to.Sun’s web page on the subject.
3- Return to the directory bdk1_1\beans. Enter the jars subdirectory. Delete the buttons jar. (Note: This is not necessary, though in doing this you can see the workings of the Make program as buttons.jar later re-emerges, thus indicating success.)
4- Download a copy of Microsoft’s Nmake utlilty to your computer and place it in bdk1_1\beans\demo.
5- Open Command Prompt. Enter cd C:\bdk1_1\ beans\demo. Then…
6-C:\bdk1_1\beans\demo>PATH=C:\Sun\AppServer\jdk\bin This path must be set to wherever your jdk\bin or sdk\bin may be located. Test to see if the path has been successfully set by entering into...
7-C:\bdk1_1\beans\demo>java. If it fails, a message will result announcing that ’java’ is not recognized as an internal or external command, operable program or batch file. If the test succeeds, a series of text will follow beginning with Usage: java [options] class [args…] This shows it to be time for the next step.
8- C:\bdk1_1\beans\demo> nmake –f buttons.mk
9- This will generate a new buttons jar file in the jar directory and compile the java files in the buttons subdirectory. The Bean Box is now ready for use, including buttons.