http://courses.cs.vt.edu/~cs4244/Notes/Beans/createBean.html
https://javaproglang.blogspot.com/2014/04/developing-simple-bean.html#.X4-CUdUzbIU
Please See Viedo First & Follow it .
Step 1: Put this source code into a file named "SimpleBean.java"
import java.awt.*;
import java.io.Serializable;public class SimpleBean extends Canvas
implements Serializable{//Constructor sets inherited properties
public SimpleBean(){
setSize(60,40);
setBackground(Color.red);
}}
What will the above code look like when displayed in the bean box?
Step 2: Compile the file:
- javac SimpleBean.java
Step 3: Create a manifest file, named "manifest.tmp":
Check other or create path folder in demo/SimpleBean/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Name: FirstBean.class
Java-Bean: True
Created-By: 1.2.2 (Sun Microsystems Inc.)
Step 4: Create the JAR file, named "SimpleBean.jar":
jar cfM SimpleBean.jar SimpleBean.classThen verify that the content is correct by the command "jar tf SimpleBean.jar".
Step 5:
- Start the Bean Box.
- Load JAR into Bean Box by selecting "LoadJar..." under the File menu.
- CD to c:\Program Files\BDK1.1\beanbox\.
Then type "run".
Step 6:
- After the file selection dialog box is closed, change focus to the "ToolBox" window. You'll see "SimpleBean" appear at the bottom of the toolbox window.
- Select SimpleBean.jar.
- Cursor will change to a plus. In the middle BeanBox window, you can now click to drop in what will appear to be a colored rectangle.
No comments:
Post a Comment