home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jruntime.z / NewBean.java < prev    next >
Text File  |  1997-08-25  |  1KB  |  59 lines

  1. // This snippet creates a new empty bean
  2. //
  3. // <File=NewBean.java>
  4.  
  5. //Title:
  6. //Version:      
  7. //Copyright:
  8. //Author:       
  9. //Company:      
  10. //Description:
  11.  
  12.  
  13. //<PACKAGE>
  14.  
  15. import java.awt.*;
  16. import java.awt.event.*;
  17. import borland.jbcl.layout.*;
  18. import borland.jbcl.control.*;
  19. import borland.jbcl.view.*;
  20. import borland.jbcl.util.BlackBox;
  21.  
  22. public class NewBean extends BeanPanel implements BlackBox{
  23.   BevelPanel bevelPanel1 = new BevelPanel();
  24.   BorderLayout borderLayout1 = new BorderLayout();
  25.   XYLayout xYLayout1 = new XYLayout();
  26.  
  27.   public NewBean() {
  28.     try {
  29.       jbInit();
  30.     }
  31.     catch (Exception e) {
  32.       e.printStackTrace();
  33.     }
  34.   }
  35.  
  36.   public void jbInit() throws Exception{
  37.     bevelPanel1.setLayout(xYLayout1);
  38.     this.setLayout(borderLayout1);
  39.     this.add(bevelPanel1, BorderLayout.CENTER);
  40.   }
  41.  
  42.   // Example properties
  43.   private String example = "Example1";
  44.  
  45.   public void setExample(String s) {
  46.     example=s;
  47.   }
  48.   public String getExample(){
  49.     return example;
  50.   }
  51.  
  52.   // Example event
  53.   public static final String EXAMPLE_EVENT = "ExampleEvent";
  54.   protected void fireExampleActionEvent() {
  55.     //Args:  event source,event ID, event command
  56.     processActionEvent(new ActionEvent(this,ActionEvent.ACTION_PERFORMED, EXAMPLE_EVENT));
  57.   }
  58. }
  59.