How do I package a component to be used as a JavaBean?
John Zukowski Beans can be packaged in JAR, ZIP, other archives. Using the jar tool that comes with the JSDK, you would need to perform the following two steps:
- Create descriptive text file called a manifest saying which classes are meant to be used as beans. For each bean, you would need to add a Java-Bean: true line like the following:
Name: simple/Simple.class Java-Bean: true
- Then, create the JAR file, being sure to use the manifest file you created:
[UNIX/DOS prompt] jar cvmf simple.txt Simple.jar simple/Simple.class
Now, when you load the JAR file into the visual development environment, it will know which classes are bean components and which aren't.