Writing a Simple Bean in Java Technology

Writing a Simple Bean in Java Technology
Writing a Simple Bean in Java Technology

Steps:

1. Write bean code and put it in a file in your own directory.

Example:

import java.io.Serializable;
import java.awt.*;
public class testbean exends Canvas
implements Serializable
{
public testbean()
{
setSize(60,60);
setBackground(Color.blue);
}
}

3. Compile

javac testbean.java

4. Create manifest file – Edit test.mft

Name: testbean.class
Java-Bean: True

5. Create JAR file

jar cfm testbean.jar test.mft testbean.class

6. Load jar file into tool box using File-loadjar

Leave a Reply