Thursday, October 19, 2017

Bean

 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.class

Then verify that the content is correct by the command "jar tf SimpleBean.jar".

Step 5:

  1. Start the Bean Box.
    1. CD to c:\Program Files\BDK1.1\beanbox\.
      Then type "run".
  2. Load JAR into Bean Box by selecting "LoadJar..." under the File menu.

  3.  

Step 6:

  1. 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.
  2. Select SimpleBean.jar.
  3. 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

CORBA Java Tutorial using Netbeans and Java 8.

CORBA-Example A simple CORBA implementation using Java Echo.idl module EchoApp{ interface Echo{ string echoString(); }; }; ...