- A Java Bean is a reusable software component that can perform simple or complex functions. It may have a visible or invisible user interface.
- Beans can work autonomously on a local machine or cooperate with other distributed components. They obtain the benefits of Java's "write once, run anywhere" model.
- Application builder tools allow designers to configure, connect, and test Beans to create applications. They provide palettes of Beans, allow laying out Beans visually, and enable connecting Beans through event mappings.
JavaBeans are reusable software components that can be visually manipulated in builder tools. They follow certain conventions like having a default constructor and getter/setter methods for properties. Beans are platform independent and their methods, properties, and events can be controlled. There are four types of properties beans can expose: simple, indexed, bound, and constrained. Simple properties have a single getter/setter pair while indexed properties support arrays. Bound properties notify listeners of changes while constrained properties can have changes vetoed by listeners.
Java beans allow the creation of reusable software components. A bean is a reusable component that can have its properties, events, and methods manipulated visually. Beans enable components to be developed once and reused across applications. Key features of beans include properties, events, introspection for analysis of capabilities, and customization to allow configuration of appearance and behavior. Beans also support persistence to save and restore the component's customized state.
The document provides information about input/output management in operating systems. It discusses I/O devices, device controllers, direct memory access and DMA controllers. Some key points include:
I/O devices are divided into block devices which access fixed size blocks of data and character devices which access data as a sequential stream. Device controllers act as an interface between devices and device drivers. Direct memory access allows data transfer between memory and devices without CPU involvement by using a DMA controller. DMA controllers program data transfers and arbitrate bus access.
The document discusses Java exception handling concepts. It explains that multiple catch blocks can be used to catch different types of exceptions, with the first matching exception handler executing. Finally blocks provide code that is always executed after a try/catch block, such as for cleanup. Finally blocks ensure code is executed whether an exception occurs or not.
Introduction to java beans, java beans, Core java, j2se, getting started with java beans programming, java to standard edition, beans in java, beans programming in java
The document discusses the structure of file systems. It explains that a file system provides mechanisms for storing and accessing files and data. It uses a layered approach, with each layer responsible for specific tasks related to file management. The logical file system contains metadata and verifies permissions and paths. It maps logical file blocks to physical disk blocks using a file organization module, which also manages free space. The basic file system then issues I/O commands to access those physical blocks via device drivers, with I/O controls handling interrupts.
The document summarizes the key aspects of direct linking loaders. A direct linking loader allows for multiple procedure and data segments and flexible intersegment referencing. It provides assembler output with the length and symbol tables (USE and DEFINITION) to the loader. The loader performs two passes, building a Global External Symbol Table in Pass 1 and performing relocation and linking in Pass 2 using the object decks with External Symbol Dictionary, instructions/data, and relocation/linkage sections. This allows combining and executing object code from separate object programs.
The document discusses various methods for input/output (IO) in computer systems, including IO interfaces, programmed IO, interrupt-initiated IO, direct memory access (DMA), and input-output processors (IOPs). It describes how each method facilitates the transfer of data between the CPU, memory, and external IO devices.
JavaBeans are reusable software components that can be visually manipulated in builder tools. They follow certain conventions like having a default constructor and getter/setter methods for properties. Beans are platform independent and their methods, properties, and events can be controlled. There are four types of properties beans can expose: simple, indexed, bound, and constrained. Simple properties have a single getter/setter pair while indexed properties support arrays. Bound properties notify listeners of changes while constrained properties can have changes vetoed by listeners.
Java beans allow the creation of reusable software components. A bean is a reusable component that can have its properties, events, and methods manipulated visually. Beans enable components to be developed once and reused across applications. Key features of beans include properties, events, introspection for analysis of capabilities, and customization to allow configuration of appearance and behavior. Beans also support persistence to save and restore the component's customized state.
The document provides information about input/output management in operating systems. It discusses I/O devices, device controllers, direct memory access and DMA controllers. Some key points include:
I/O devices are divided into block devices which access fixed size blocks of data and character devices which access data as a sequential stream. Device controllers act as an interface between devices and device drivers. Direct memory access allows data transfer between memory and devices without CPU involvement by using a DMA controller. DMA controllers program data transfers and arbitrate bus access.
The document discusses Java exception handling concepts. It explains that multiple catch blocks can be used to catch different types of exceptions, with the first matching exception handler executing. Finally blocks provide code that is always executed after a try/catch block, such as for cleanup. Finally blocks ensure code is executed whether an exception occurs or not.
Introduction to java beans, java beans, Core java, j2se, getting started with java beans programming, java to standard edition, beans in java, beans programming in java
The document discusses the structure of file systems. It explains that a file system provides mechanisms for storing and accessing files and data. It uses a layered approach, with each layer responsible for specific tasks related to file management. The logical file system contains metadata and verifies permissions and paths. It maps logical file blocks to physical disk blocks using a file organization module, which also manages free space. The basic file system then issues I/O commands to access those physical blocks via device drivers, with I/O controls handling interrupts.
The document summarizes the key aspects of direct linking loaders. A direct linking loader allows for multiple procedure and data segments and flexible intersegment referencing. It provides assembler output with the length and symbol tables (USE and DEFINITION) to the loader. The loader performs two passes, building a Global External Symbol Table in Pass 1 and performing relocation and linking in Pass 2 using the object decks with External Symbol Dictionary, instructions/data, and relocation/linkage sections. This allows combining and executing object code from separate object programs.
The document discusses various methods for input/output (IO) in computer systems, including IO interfaces, programmed IO, interrupt-initiated IO, direct memory access (DMA), and input-output processors (IOPs). It describes how each method facilitates the transfer of data between the CPU, memory, and external IO devices.
This presentation introduces Java packages, including system packages that are part of the Java API and user-defined packages. It discusses how packages organize related classes and interfaces, the structure of package names and directories, and how to create and access packages. Packages provide advantages like grouping related code, preventing name collisions, and improving reusability.
Direct memory access (DMA) allows certain hardware subsystems to access computer memory independently of the central processing unit (CPU). During DMA transfer, the CPU is idle while an I/O device reads from or writes directly to memory using a DMA controller. This improves data transfer speeds as the CPU does not need to manage each memory access and can perform other tasks. DMA is useful when CPU cannot keep up with data transfer speeds or needs to work while waiting for a slow I/O operation to complete.
The document provides an overview of parallel processing and multiprocessor systems. It discusses Flynn's taxonomy, which classifies computers as SISD, SIMD, MISD, or MIMD based on whether they process single or multiple instructions and data in parallel. The goals of parallel processing are to reduce wall-clock time and solve larger problems. Multiprocessor topologies include uniform memory access (UMA) and non-uniform memory access (NUMA) architectures.
There are three main methods to map main memory addresses to cache memory addresses: direct mapping, associative mapping, and set-associative mapping. Direct mapping is the simplest but least flexible method, while associative mapping is most flexible but also slowest. Set-associative mapping combines aspects of the other two methods, dividing the cache into sets with multiple lines to gain efficiency while remaining reasonably flexible.
Overview of Java RMI remoting.
RMI is a lightweight Java technology that provides access to remote methods, similar to RPC, but object-oriented. RMI basically provides remote object access for a client and object registration for servers.
RMI is both a Java API (java.rmi.* package) as well as a transport protocol definition for transporting RMI calls through a network.
RMI is a Java technology since it requires that client and server objects run in a JVM (Java Virtual Machine). By using IIOP as transport protocol, however, it is possible to connect RMI-clients to non-Java server objects (e.g. CORBA).
RMI defines the elements client, server, RMI registry where servers register their services and possibly a plain vanilla web server that can be used by clients to dynamically load object classes to access servers.
This document discusses Java beans and Enterprise Java Beans (EJB). It defines a Java bean as a reusable software component that can be visually manipulated in builder tools. The primary goal of Java beans is to be write once and run anywhere (WORA). EJBs are server-side components that enable rapid development of distributed, transactional, and secure applications. EJBs provide features like transaction management, distributed transaction support, and portability. The document outlines the EJB architecture including EJB containers, clients, interfaces, stubs, and the different types of enterprise beans - entity beans, session beans, and message-driven beans.
- Physical storage media can be classified by access speed, cost per unit of data, and reliability. This includes cache, main memory, flash memory, magnetic disks, optical disks, and magnetic tapes.
- Faster but more expensive media like cache and main memory are primary storage, while magnetic disks represent secondary storage. Tapes and optical disks provide tertiary, offline storage.
- Volatility also differs, with volatile storage like main memory losing data on power loss, while nonvolatile media like disks and flash retain data. The database typically resides on nonvolatile secondary storage for long-term access.
1. The document discusses the differences between a web server and application server, with application servers containing both a web container and EJB container while web servers only contain a web container and do not support clustering.
2. It describes the key components of EJB - the home interface, remote interface, and bean class - and their purposes. The home interface acts as a factory, the remote interface contains business methods, and the bean class implements both interfaces.
3. It outlines the basic architecture and workflow of how a client accesses EJBs, first looking up the home interface and then using it to get a reference to the remote interface to invoke business methods on the bean.
IPC allows processes to communicate and share resources. There are several common IPC mechanisms, including message passing, shared memory, semaphores, files, signals, sockets, message queues, and pipes. Message passing involves establishing a communication link and exchanging fixed or variable sized messages using send and receive operations. Shared memory allows processes to access the same memory area. Semaphores are used to synchronize processes. Files provide durable storage that outlives individual processes. Signals asynchronously notify processes of events. Sockets enable two-way point-to-point communication between processes. Message queues allow asynchronous communication where senders and receivers do not need to interact simultaneously. Pipes create a pipeline between processes by connecting standard streams.
The document discusses memory management techniques used in operating systems. It describes logical vs physical addresses and how relocation registers map logical addresses to physical addresses. It covers contiguous and non-contiguous storage allocation, including paging and segmentation. Paging divides memory into fixed-size frames and pages, using a page table and translation lookaside buffer (TLB) for address translation. Segmentation divides memory into variable-sized segments based on a program's logical structure. Virtual memory and demand paging are also covered, along with page replacement algorithms like FIFO, LRU and optimal replacement.
The document discusses loaders, which are system software programs that perform the loading function of placing a program into memory for execution. There are several types of loaders: compile-and-go loaders directly place assembled code into memory; absolute loaders place code at specified addresses; relocating loaders allow code to be loaded at different addresses and combine programs. Relocating loaders output object code, symbol tables, and relocation information to perform allocation, relocation, linking, and loading separately from assembly. Direct-linking loaders provide more flexibility by allowing multiple program and data segments with intersegment references.
The document discusses address sequencing in a microprogram control unit. It begins by defining key terms like control address register, which stores the initial address of the first microinstruction. It then explains that the next address generator is responsible for selecting the next address from control memory based on the current microinstruction. Microinstructions are stored in control memory in groups that make up routines corresponding to each machine instruction. The document also discusses control memory, hardwired control vs microprogrammed control, and examples of next address generation and status bits.
The document discusses various event handling classes in Java including ActionEvent, KeyEvent, MouseEvent, MouseMotionEvent, FocusEvent, WindowEvent, and ItemEvent. It provides examples of how to use each event class by implementing the appropriate listener interface and defining event handling methods. Key points covered include common event handling terms like event, event source, and event listener. It also summarizes the typical methods provided by each event class.
The document discusses Java AWT and Swing GUI programming. It provides details on commonly used AWT and Swing components like Frame, Button, Label, Textfield. It explains the hierarchy and differences between AWT and Swing. Examples are provided to demonstrate creating a simple GUI using various components like Buttons, Labels and adding them to a Frame. The document also covers other Swing components like Checkboxes, Scrollpanes and containers like Frame, Dialog, Panel.
The document discusses exception handling in Java. It defines exceptions as runtime errors that occur during program execution. It describes different types of exceptions like checked exceptions and unchecked exceptions. It explains how to use try, catch, throw, throws and finally keywords to handle exceptions. The try block contains code that might throw exceptions. The catch block catches and handles specific exceptions. The finally block contains cleanup code that always executes regardless of exceptions. The document provides examples of exception handling code in Java.
Virtual Memory
• Copy-on-Write
• Page Replacement
• Allocation of Frames
• Thrashing
• Operating-System Examples
Background
Page Table When Some PagesAre Not in Main Memory
Steps in Handling a Page Fault
This document provides information on creating and working with menus in Visual Basic 6.0. It explains that menus are an important part of software interfaces and are different from other controls. It provides steps for building a simple menu by filling in fields in the Menu Editor window. The document also discusses important menu item properties like Name, Caption, Checked, Enabled, Shortcut and Visible. It includes code examples that demonstrate changing a form's color by clicking different menu items and toggling a label's visibility based on a menu item's Checked property.
Java Bean is a reusable software component that can be visually assembled into applications using visual development tools. It follows specific conventions like having public no-arg constructors, allowing properties to be read and written with get/set methods, and firing events. Beans are customizable, portable, and can persist their state. Introspection allows determining a bean's properties, methods, and events at runtime.
Java Network Programming getting started, Getting Started with java network programming, two tier architecture, java client server programming, core java, java to standard edition, core java, Introduction to network programming in java
This presentation introduces Java packages, including system packages that are part of the Java API and user-defined packages. It discusses how packages organize related classes and interfaces, the structure of package names and directories, and how to create and access packages. Packages provide advantages like grouping related code, preventing name collisions, and improving reusability.
Direct memory access (DMA) allows certain hardware subsystems to access computer memory independently of the central processing unit (CPU). During DMA transfer, the CPU is idle while an I/O device reads from or writes directly to memory using a DMA controller. This improves data transfer speeds as the CPU does not need to manage each memory access and can perform other tasks. DMA is useful when CPU cannot keep up with data transfer speeds or needs to work while waiting for a slow I/O operation to complete.
The document provides an overview of parallel processing and multiprocessor systems. It discusses Flynn's taxonomy, which classifies computers as SISD, SIMD, MISD, or MIMD based on whether they process single or multiple instructions and data in parallel. The goals of parallel processing are to reduce wall-clock time and solve larger problems. Multiprocessor topologies include uniform memory access (UMA) and non-uniform memory access (NUMA) architectures.
There are three main methods to map main memory addresses to cache memory addresses: direct mapping, associative mapping, and set-associative mapping. Direct mapping is the simplest but least flexible method, while associative mapping is most flexible but also slowest. Set-associative mapping combines aspects of the other two methods, dividing the cache into sets with multiple lines to gain efficiency while remaining reasonably flexible.
Overview of Java RMI remoting.
RMI is a lightweight Java technology that provides access to remote methods, similar to RPC, but object-oriented. RMI basically provides remote object access for a client and object registration for servers.
RMI is both a Java API (java.rmi.* package) as well as a transport protocol definition for transporting RMI calls through a network.
RMI is a Java technology since it requires that client and server objects run in a JVM (Java Virtual Machine). By using IIOP as transport protocol, however, it is possible to connect RMI-clients to non-Java server objects (e.g. CORBA).
RMI defines the elements client, server, RMI registry where servers register their services and possibly a plain vanilla web server that can be used by clients to dynamically load object classes to access servers.
This document discusses Java beans and Enterprise Java Beans (EJB). It defines a Java bean as a reusable software component that can be visually manipulated in builder tools. The primary goal of Java beans is to be write once and run anywhere (WORA). EJBs are server-side components that enable rapid development of distributed, transactional, and secure applications. EJBs provide features like transaction management, distributed transaction support, and portability. The document outlines the EJB architecture including EJB containers, clients, interfaces, stubs, and the different types of enterprise beans - entity beans, session beans, and message-driven beans.
- Physical storage media can be classified by access speed, cost per unit of data, and reliability. This includes cache, main memory, flash memory, magnetic disks, optical disks, and magnetic tapes.
- Faster but more expensive media like cache and main memory are primary storage, while magnetic disks represent secondary storage. Tapes and optical disks provide tertiary, offline storage.
- Volatility also differs, with volatile storage like main memory losing data on power loss, while nonvolatile media like disks and flash retain data. The database typically resides on nonvolatile secondary storage for long-term access.
1. The document discusses the differences between a web server and application server, with application servers containing both a web container and EJB container while web servers only contain a web container and do not support clustering.
2. It describes the key components of EJB - the home interface, remote interface, and bean class - and their purposes. The home interface acts as a factory, the remote interface contains business methods, and the bean class implements both interfaces.
3. It outlines the basic architecture and workflow of how a client accesses EJBs, first looking up the home interface and then using it to get a reference to the remote interface to invoke business methods on the bean.
IPC allows processes to communicate and share resources. There are several common IPC mechanisms, including message passing, shared memory, semaphores, files, signals, sockets, message queues, and pipes. Message passing involves establishing a communication link and exchanging fixed or variable sized messages using send and receive operations. Shared memory allows processes to access the same memory area. Semaphores are used to synchronize processes. Files provide durable storage that outlives individual processes. Signals asynchronously notify processes of events. Sockets enable two-way point-to-point communication between processes. Message queues allow asynchronous communication where senders and receivers do not need to interact simultaneously. Pipes create a pipeline between processes by connecting standard streams.
The document discusses memory management techniques used in operating systems. It describes logical vs physical addresses and how relocation registers map logical addresses to physical addresses. It covers contiguous and non-contiguous storage allocation, including paging and segmentation. Paging divides memory into fixed-size frames and pages, using a page table and translation lookaside buffer (TLB) for address translation. Segmentation divides memory into variable-sized segments based on a program's logical structure. Virtual memory and demand paging are also covered, along with page replacement algorithms like FIFO, LRU and optimal replacement.
The document discusses loaders, which are system software programs that perform the loading function of placing a program into memory for execution. There are several types of loaders: compile-and-go loaders directly place assembled code into memory; absolute loaders place code at specified addresses; relocating loaders allow code to be loaded at different addresses and combine programs. Relocating loaders output object code, symbol tables, and relocation information to perform allocation, relocation, linking, and loading separately from assembly. Direct-linking loaders provide more flexibility by allowing multiple program and data segments with intersegment references.
The document discusses address sequencing in a microprogram control unit. It begins by defining key terms like control address register, which stores the initial address of the first microinstruction. It then explains that the next address generator is responsible for selecting the next address from control memory based on the current microinstruction. Microinstructions are stored in control memory in groups that make up routines corresponding to each machine instruction. The document also discusses control memory, hardwired control vs microprogrammed control, and examples of next address generation and status bits.
The document discusses various event handling classes in Java including ActionEvent, KeyEvent, MouseEvent, MouseMotionEvent, FocusEvent, WindowEvent, and ItemEvent. It provides examples of how to use each event class by implementing the appropriate listener interface and defining event handling methods. Key points covered include common event handling terms like event, event source, and event listener. It also summarizes the typical methods provided by each event class.
The document discusses Java AWT and Swing GUI programming. It provides details on commonly used AWT and Swing components like Frame, Button, Label, Textfield. It explains the hierarchy and differences between AWT and Swing. Examples are provided to demonstrate creating a simple GUI using various components like Buttons, Labels and adding them to a Frame. The document also covers other Swing components like Checkboxes, Scrollpanes and containers like Frame, Dialog, Panel.
The document discusses exception handling in Java. It defines exceptions as runtime errors that occur during program execution. It describes different types of exceptions like checked exceptions and unchecked exceptions. It explains how to use try, catch, throw, throws and finally keywords to handle exceptions. The try block contains code that might throw exceptions. The catch block catches and handles specific exceptions. The finally block contains cleanup code that always executes regardless of exceptions. The document provides examples of exception handling code in Java.
Virtual Memory
• Copy-on-Write
• Page Replacement
• Allocation of Frames
• Thrashing
• Operating-System Examples
Background
Page Table When Some PagesAre Not in Main Memory
Steps in Handling a Page Fault
This document provides information on creating and working with menus in Visual Basic 6.0. It explains that menus are an important part of software interfaces and are different from other controls. It provides steps for building a simple menu by filling in fields in the Menu Editor window. The document also discusses important menu item properties like Name, Caption, Checked, Enabled, Shortcut and Visible. It includes code examples that demonstrate changing a form's color by clicking different menu items and toggling a label's visibility based on a menu item's Checked property.
Java Bean is a reusable software component that can be visually assembled into applications using visual development tools. It follows specific conventions like having public no-arg constructors, allowing properties to be read and written with get/set methods, and firing events. Beans are customizable, portable, and can persist their state. Introspection allows determining a bean's properties, methods, and events at runtime.
Java Network Programming getting started, Getting Started with java network programming, two tier architecture, java client server programming, core java, java to standard edition, core java, Introduction to network programming in java
This document discusses JavaBeans, which are reusable Java components that can be visually manipulated in application builder tools. JavaBeans follow certain conventions like having a no-argument constructor and getter/setter methods for properties. They can represent user interface elements like buttons and text boxes, and be assembled visually into applications. The document covers the components of JavaBeans, how they are assembled, advantages of using JavaBeans, and the steps to create a JavaBean class.
The document provides an introduction to component-based development using JavaBeans. It discusses how JavaBeans allow developers to visually assemble applications from reusable software components known as beans. Beans expose their functionality through properties, methods, and events to allow them to be manipulated visually in builder tools without code. The document outlines the basics of writing beans, including design patterns for properties, events, and customization. It also introduces the BeanBox builder tool for working with beans.
Guadalajara is a city and municipality located in the autonomous community of Castile-La Mancha in Spain. It is situated in the natural region of La Alcarria. The document provides brief information about the location of Guadalajara within Spain.
JavaBeans are reusable software components that can be visually composed using builder tools. They have properties that can be edited visually, support events to communicate between components, and allow introspection to discover their features. JavaBeans use serialization and XML for persistence so their state can be saved and restored. They provide a portable, platform-independent way to create reusable application components.
Java Beans are reusable software components that can be visually manipulated in builder tools. They allow developers to write reusable components once and run them anywhere on any Java-enabled platform. Key features of Java Beans include properties, events, persistence, and introspection to allow visual manipulation in builder tools. Customization is also supported to allow customizing a bean's appearance and behavior.
A bean is a reusable software component based on Sun's JavaBeans specification that can be manipulated visually in a builder tool.“
The JavaBeans technology enables vendors to create environments that make it dramatically easier to develop user interfaces for Java applications.
This document provides an overview of Java Beans. It defines Java Beans as reusable software components that extend the power of Java by enabling objects to be manipulated visually at design time. The key points covered include: Java Beans specifications which define requirements like having public no-arg constructors and implementing Serializable; getter and setter methods for accessing bean properties; event models for handling bean events; and steps for creating a basic Java Bean component and packaging it in a JAR file.
The document discusses JavaBeans, which are reusable software components that can be visually manipulated in builder tools. JavaBeans follow specific conventions to expose their properties and events so they can be edited visually without code. Builder tools can inspect beans at design time to display and edit their properties. Events allow beans to communicate, and beans can also be customized through property editors or customizers.
The document discusses Java beans, which are reusable software components that can be visually manipulated in builder tools. Java beans follow certain rules, like implementing the Serializable interface and having a no-argument constructor. They can have properties, events, persistence, and allow for customization and introspection. Common examples of Java beans include GUI components like buttons and text fields. Builder tools allow visual creation of beans and display their properties through reflection.
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTHBhavsingh Maloth
This document provides information on Java beans including:
- The characteristics that distinguish a Java bean from other Java classes
- The different types of bean properties (simple, boolean, indexed) and the naming conventions for getter and setter methods
- The advantages of using Java beans such as reusability and global operability
- How to create a new bean through steps such as creating source files, compiling, generating a JAR file
- Additional bean-related topics like events, customizers, the Bean Developer Kit, and the JavaBeans API architecture
This document discusses several Java technologies for building distributed applications: RMI, CORBA, JavaBeans, and Java IDL. It provides details on:
- RMI allows Java objects to invoke methods on remote objects residing in different JVMs. It uses stubs and skeletons as proxies.
- CORBA is a standard for building distributed applications and allows objects to interact across different platforms. It uses IDL for interface definitions.
- JavaBeans is a software component model for reusable GUI components. The document demonstrates how to create, configure, save and load JavaBeans.
Java beans are reusable software components that can be visually manipulated in builder tools. They follow certain rules like implementing Serializable and having a no-argument constructor. Beans have properties that determine their appearance and behavior which can be accessed programmatically or visually in property sheets. Common bean components include buttons, text fields, and lists. Builder tools use reflection to read bean properties and allow visual editing of beans.
The document describes how to create a simple JavaBean called SimpleBean using the Bean Development Kit (BDK). It involves:
1. Creating a SimpleBean class that extends Canvas and implements Serializable.
2. Writing a makefile to compile SimpleBean and generate a JAR file.
3. Running make to compile SimpleBean and create a JAR, then loading the JAR into the BeanBox ToolBox.
4. Dropping an instance of SimpleBean into the BeanBox to inspect its properties, methods, and events using the Properties sheet and menus.
This document provides an overview of Java Bean component models. It discusses that Java beans are reusable software components that can be visually manipulated in builder tools. It also describes the different types of ports beans can have including methods, properties, events sources, and event sinks. The document outlines how to implement properties, events, and listeners in beans to make them customizable. It also discusses how beans can be made persistent through serialization and how customizers can provide customized user interfaces for complex beans.
This document provides an overview of Java beans and bean-related concepts. It discusses creating a Java bean class with events, supplying additional bean information like property editors and customizers, and creating bean classes that use the bean context API. The key points are:
- Java beans follow conventions to define readable and writable properties
- Beans can generate custom events and listeners need to be registered
- Property editors customize how properties appear in builder tools
- Customizers provide full GUI control over bean customization
- The bean context API allows beans to be contained and interact within a shared environment
This document discusses fragments, menus, and contextual modes in Android. It defines fragments as reusable parts of an activity's user interface that have their own lifecycles. The document provides instructions for creating fragments, adding them to activities, and replacing them dynamically. It also discusses using the action bar to define options menus and handling menu item selections. Finally, it covers activating a contextual mode for long presses on an element and defining actions for the contextual menu bar.
The document presents an outline for a presentation on commercial systems. It includes:
- Part A presented by Bahman on Java Beans and Enterprise Java Beans.
- Part B presented by John on CORBA, OLE, and ActiveX.
- Part C presented by Andrew on COM, DCOM, and COM+.
This document provides an overview of Brandon Miller's programming portfolio, which includes several projects involving creating class libraries and interfaces in C# (.NET), building Windows Forms and ASP.NET applications that interface with SQL databases using stored procedures and LINQ, and parsing XML files using LINQ to XML. The projects demonstrate skills in object-oriented programming, database access, user interface design, and XML parsing.
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016Peter Horsbøll Møller
An introduction to how to get started with the MapBasic RIBBONLib for integrating MapBasic applications into the Ribbon of MapInfo Pro 64 bit.
Besides showing how to add controls to the interface, I have also added answers to some of the questions that I have come across in the last year related to the RIBBONLib
The document provides a step-by-step walkthrough for building a simple iOS application called HelloPoly using Xcode and Interface Builder. It describes laying out the user interface, defining a controller class, connecting the interface to the controller, and generating source files for the controller class. Key steps include adding buttons and labels to the interface, setting up outlets and actions for the controller class, and writing implementation code for the action methods to log messages when the buttons are pressed. The goal is to demonstrate basic iPhone application development workflow and setting up the standard MVC architecture pattern with model, view, and controller classes.
Visual Basic is a programming system developed by Microsoft that allows users to create graphical user interface applications for Windows using an event-driven programming language based on BASIC. It provides tools and objects for building forms, using controls and handling events, as well as features for database access, debugging, and distributing applications. Newer versions of Visual Basic introduced improvements like faster compilers, additional database and internet capabilities.
Android Application Development - Level 2Isham Rashik
This document provides information about an Android application development workshop on level 2 concepts. It includes objectives like understanding new concepts for designing user interfaces in XML, object-oriented programming in Java, and applying concepts to create interactive apps. It describes UI elements like EditText, RadioButtons, CheckBoxes and their usage. It also covers OOP concepts like classes, objects, inheritance and methods. It provides examples to demonstrate concepts like creating objects, calling methods, finding views by ID. Finally, it includes code for a temperature converter app as an example to apply concepts.
Metamorphosis from Forms to Java: A technical lead's perspective, part IIMichael Fons
This document provides an overview of key concepts for transitioning from Forms development to Java and ADF, including deployment, the MVC pattern, beans, GUI components, collections vs iterators, and tips. It includes 11 demo sections walking through creating a basic model and UI, visual designer, bindings, passing data between pages, authorization, and extending the framework. The summaries aim to highlight the main topics covered in each section at a high level.
- Form modules contain objects and code routines, menu modules contain menus and menu commands, and library modules contain reusable procedures, functions, and packages.
- Default file extensions are .fmb for form modules, .fmx for executable form modules, and .mmb and .mmx for menu modules.
- Data blocks contain form items while control blocks are independent of database tables and views. Property classes set reusable properties and visual attributes set appearance properties.
- Record groups provide data to LOVs and list items and enable client-side validation. They can be static, query-based, or non-query.
- Libraries contain reusable subprograms that can be attached to forms, menus, or other libraries.
Visual Basic has an integrated development environment (IDE) that contains various elements like menus, toolbars, a toolbox, and windows for code, properties, and projects. The IDE allows developers to design forms with controls, set control properties, write code in the code editor, and manage projects. Controls like buttons, text boxes, and labels are used to build the user interface, which appears on forms. Events and event procedures are important concepts, as Visual Basic is event-driven - code only runs in response to events.
This document discusses Java Beans, including:
- Java Beans are reusable Java classes that follow common conventions like having getter/setter methods and a no-arg constructor.
- The Java Beans component model defines Beans as reusable visual components that can be manipulated in builder tools.
- Creating a Java Bean class involves following conventions like making properties accessible via getter/setter methods.
- Indexed, bound, and constrained properties are special types of properties that can be array-based or notify listeners of changes.
Android and IOS UI Development (Android 5.0 and iOS 9.0)Michael Shrove
The document discusses various project templates available in iOS for building mobile apps, including:
- Single view, tab bar, master-detail, page-based, and game templates
- The templates provide a starting structure and interface for different types of apps
- It also covers controllers like tab bar, navigation, and table view controllers that are used to organize interfaces in iOS apps
This document provides an overview of servlets and related Java web technologies including:
- The servlet API and common interfaces like Servlet, ServletRequest, and ServletResponse.
- How servlets handle HTTP requests and responses using classes like HttpServlet, HttpServletRequest and HttpServletResponse.
- Additional topics covered include session tracking, using JDBC with servlets, HTML and Java object communication with servlets, and security issues.
This document provides an overview of JavaBeans. It discusses that JavaBeans are reusable software components that can be visually manipulated in builder tools. The key characteristics of JavaBeans include having public properties with getter and setter methods, supporting events, and having their state persisted. The document outlines concepts such as introspection, properties, events, and customization. It also discusses how to create simple JavaBeans and use them in applications.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Chapter wise All Notes of First year Basic Civil Engineering.pptxDenish Jangid
Chapter wise All Notes of First year Basic Civil Engineering
Syllabus
Chapter-1
Introduction to objective, scope and outcome the subject
Chapter 2
Introduction: Scope and Specialization of Civil Engineering, Role of civil Engineer in Society, Impact of infrastructural development on economy of country.
Chapter 3
Surveying: Object Principles & Types of Surveying; Site Plans, Plans & Maps; Scales & Unit of different Measurements.
Linear Measurements: Instruments used. Linear Measurement by Tape, Ranging out Survey Lines and overcoming Obstructions; Measurements on sloping ground; Tape corrections, conventional symbols. Angular Measurements: Instruments used; Introduction to Compass Surveying, Bearings and Longitude & Latitude of a Line, Introduction to total station.
Levelling: Instrument used Object of levelling, Methods of levelling in brief, and Contour maps.
Chapter 4
Buildings: Selection of site for Buildings, Layout of Building Plan, Types of buildings, Plinth area, carpet area, floor space index, Introduction to building byelaws, concept of sun light & ventilation. Components of Buildings & their functions, Basic concept of R.C.C., Introduction to types of foundation
Chapter 5
Transportation: Introduction to Transportation Engineering; Traffic and Road Safety: Types and Characteristics of Various Modes of Transportation; Various Road Traffic Signs, Causes of Accidents and Road Safety Measures.
Chapter 6
Environmental Engineering: Environmental Pollution, Environmental Acts and Regulations, Functional Concepts of Ecology, Basics of Species, Biodiversity, Ecosystem, Hydrological Cycle; Chemical Cycles: Carbon, Nitrogen & Phosphorus; Energy Flow in Ecosystems.
Water Pollution: Water Quality standards, Introduction to Treatment & Disposal of Waste Water. Reuse and Saving of Water, Rain Water Harvesting. Solid Waste Management: Classification of Solid Waste, Collection, Transportation and Disposal of Solid. Recycling of Solid Waste: Energy Recovery, Sanitary Landfill, On-Site Sanitation. Air & Noise Pollution: Primary and Secondary air pollutants, Harmful effects of Air Pollution, Control of Air Pollution. . Noise Pollution Harmful Effects of noise pollution, control of noise pollution, Global warming & Climate Change, Ozone depletion, Greenhouse effect
Text Books:
1. Palancharmy, Basic Civil Engineering, McGraw Hill publishers.
2. Satheesh Gopi, Basic Civil Engineering, Pearson Publishers.
3. Ketki Rangwala Dalal, Essentials of Civil Engineering, Charotar Publishing House.
4. BCP, Surveying volume 1
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Diana Rendina
Librarians are leading the way in creating future-ready citizens – now we need to update our spaces to match. In this session, attendees will get inspiration for transforming their library spaces. You’ll learn how to survey students and patrons, create a focus group, and use design thinking to brainstorm ideas for your space. We’ll discuss budget friendly ways to change your space as well as how to find funding. No matter where you’re at, you’ll find ideas for reimagining your space in this session.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
Leveraging Generative AI to Drive Nonprofit Innovation
Unit iv
1. Java Beans
A Java Bean is a software component that has been designed to be reusable
in a variety of different environments. There is no restriction on the capability of
a Bean.
It may perform a simple function, such as checking the spelling of a document, or a
complex function, such as forecasting the performance of a stock portfolio.
A Bean may be visible to an end user. One example of this is a button on a graphical
user interface.
A Bean may also be invisible to a user. Software to decode a stream of multimedia
information in real time is an example of this type of building block.
A Bean may be designed to work autonomously on a user’s workstation. Software to
generate a pie chart from a set of data points is an example of a Bean that can
execute locally.
A Bean may be designed to work in cooperation with a set of other distributed
components. a Bean that provides real-time price information from a stock or
commodities exchange would need to work in cooperation with other distributed
software to obtain its data.
2. Java Beans
Advantages of Java Beans:
■ A Bean obtains all the benefits of Java’s “write-once, run-anywhere” paradigm.
■ The properties, events, and methods of a Bean that are exposed to an application
builder tool can be controlled.
■ A Bean may be designed to operate correctly in different locales, which makes it
useful in global markets.
■ Auxiliary software can be provided to help a person configure a Bean. This software is
only needed when the design-time parameters for that component are being set. It does
not need to be included in the run-time environment.
■ The configuration settings of a Bean can be saved in persistent storage and
restored at a later time.
■ A Bean may register to receive events from other objects and can generate
events that are sent to other objects.
3. Java Beans
Application Builder Tools:
an application builder tool, a utility that enables you to configure a set of Beans, connect
them together, and produce a working application.
In general, Bean builder tools have the following capabilities.
■ A palette is provided that lists all of the available Beans. As additional Beans
are developed or purchased, they can be added to the palette.
■ A worksheet is displayed that allows the designer to lay out Beans in a graphical
user interface. A designer may drag and drop a Bean from the palette to this
worksheet.
■ Special editors and customizers allow a Bean to be configured. This is the
mechanism by which the behavior of a Bean may be adapted for a particular
environment.
■ Commands allow a designer to inquire about the state and behavior of a
Bean. This information automatically becomes available when a Bean is added
to the palette.
■ Capabilities exist to interconnect Beans. This means that events generated by
one component are mapped to method invocations on other components.
■ When a collection of Beans has been configured and connected, it is possible to
save all of this information in a persistent storage area. At a later time, this
information can then be used to restore the state of the application.
4. Java Beans
Bean Development Kit(BDK):
is a simple example of a tool that enables you to create,
configure, and connect a set of Beans. There is also a set of
sample Beans with their source code.
Installing the BDK:
The Java 2 SDK must be installed on your machine for the BDK
to work. The BDK can then be downloaded from the JavaSoft
site (http://java.sun.com). It is packaged as one file that is a
self-extracting archive.
Starting the BDK
To start the BDK, follow these steps:
1. Change to the directory c:bdkbeanbox.
2. Execute the batch file called run.bat. This causes the
BDK to display the three windows shown
5. The Bean Development Kit (BDK):
Properties
customizes
selected bean.
Method Tracer displays
debugging messages (not
ToolBox has 16 discussed)
sample JavaBeans
BeanBox window tests beans.
Background currently selected
(dashed box).
6. ToolBox :
lists all of the different Beans that have been included with the
BDK.
BeanBox :
provides an area to lay out and connect the Beans selected from
the ToolBox.
used to save the developed component in bean box window
used to load jar files which represent the bean component.
used to save the loaded component as a applet, the files are
automatically generated.
gives events to communicate different component or respond for
different actions done by the bean component.
Properties :
provides the ability to configure a selected Bean.
all the properties are displayed in the properties window where we
can change the properties of a bean.
7. Create and Configure an Instance of the Molecule Bean:
Position the cursor on the ToolBox entry labeled Molecule and click
the left mouse button.
Move the cursor to the BeanBox display area and click the left mouse
button in approximately the area where you wish the Bean to be
displayed.
You can reposition the Molecule Bean by positioning the cursor over
one of the hatched borders and dragging the Bean.
You can change the molecule that is displayed by changing the
selection in the Properties window.
8.
9. Create and configure instance of ourButton Bean
Position the cursor on the ToolBox entry labeled OurButton and click
the left mouse button. You should see the cursor change to a cross.
Move the cursor to the BeanBox display area and click the left
mouse button in approximately the area where you wish the Bean to
be displayed.
You may reposition the OurButton Bean by positioning the cursor
over one of the hatched borders and dragging the Bean.
Go to the Properties window and change the label of the Bean to
“Rotate X”.
Go to the menu bar of the BeanBox and select Edit | Events | action |
actionPerformed.
Move the cursor so that it is inside the Molecule Bean display area,
and click the left mouse button. You should see the Event Target
Dialog dialog box.
10. Create and configure instance of ourButton Bean
The dialog box allows you to choose a method that should be invoked
when this button is clicked. Select the entry labeled “rotateOnX”
and click the OK button. You should see a message box appear very
briefly, stating that the tool is “Generating and compiling adaptor
class.”
11. Now create another instance of the OurButton Bean. Label it “Rotate
Y” and map its action event to the “rotateY” method of the Molecule
Bean.
12. Introspection
Introspection is the process of analyzing a Bean to determine its capabilities.
It allows an application builder tool to present information about a
component to a software designer.
Without introspection,the Java Beans technology could not operate.
There are two ways in which the developer of a Bean can indicate which of
its properties, events, and methods should be exposed by an application
builder tool.
In the first method, simple naming conventions are used. These allow the
introspection mechanisms to infer information about a Bean.
In the second way, an additional class is provided that explicitly supplies this
information.
13. The following sections indicate the design patterns for properties and
events that enable the functionality of a Bean to be determined.
Design Patterns for Properties
A property is a subset of a Bean’s state. The values assigned to the properties
determine the behavior and appearance of that component.
This section discusses three types of properties:
simple, Boolean, and indexed.
Simple Properties:
A simple property has a single value. It can be identified by the following design
patterns, where N is the name of the property and T is its type.
public T getN( );
public void setN(T arg);
A read/write property has both of these methods to access its values.
A read-only property has only a get method.
A write-only property has only a set method.
14. The following listing shows a class that has three read/write simple
properties:
public class Box
{
private double depth, height, width;
public double getDepth( )
{ return depth; }
public void setDepth(double d)
{ depth = d;}
public double getHeight( )
{ return height;}
public void setHeight(double h)
{ height = h;}
public double getWidth( )
{ return width; }
public void setWidth(double w)
{ width = w; }
}
15. Boolean Properties:
A Boolean property has a value of true or false.
It can be identified by the following design patterns, where N is
the name of the property:
public boolean isN( );
public boolean getN( );
public void setN(boolean value);
Either the first or second pattern can be used to retrieve the value of a Boolean
property. However, if a class has both of these methods, the first pattern is
used.
The following listing shows a class that has one Boolean property:
public class Line
{
private boolean dotted = false;
public boolean isDotted( )
{ return dotted;}
public void setDotted(boolean dotted)
{this.dotted = dotted;}
}
16. Indexed Properties:
An indexed property consists of multiple values. It can be identified by the following
design patterns, where N is the name of the property and T is its type:
public T getN(int index);
public void setN(int index, T value);
public T[ ] getN( );
public void setN(T values[ ]);
The following listing shows a class that has one read/write indexed property:
public class PieChart
{
private double data[ ];
public double getData(int index)
{return data[index];}
public void setData(int index, double value)
{ data[index] = value;}
public double[ ] getData( )
{ return data;}
public void setData(double[ ] values)
{
data = new double[values.length];
System.arraycopy(values, 0, data, 0, values.length);
}
}
17. Design Patterns for Events
Beans can generate events and send them to other objects. These can be identified by
the following design patterns, where T is the type of the event:
public void addTListener(TListener eventListener);
public void addTListener(TListener eventListener) throws TooManyListeners;
public void removeTListener(TListener eventListener);
These methods are used by event listeners to register an interest in events of a specific
type.
The first pattern indicates that a Bean can multicast an event to multiple listeners.
The second pattern indicates that a Bean can unicast an event to only one listener.
The third pattern is used by a listener when it no longer wishes to receive a specific type
of event notification from a Bean.
18. The following listing outlines a class that notifies other objects when a temperature
value moves outside a specific range. The two methods indicated here allow other
objects that implement the TemperatureListener interface to receive notifications when
this occurs.
public class Thermometer
{
public void addTemperatureListener(TemperatureListener tl)
{
...
}
public void removeTemperatureListener(TemperatureListener tl)
{
...
}
}
19. Developing a Simple Bean Using the BDK
Our new component is called the Colors Bean.
It appears as either a rectangle or ellipse that is filled with a color.
A color is chosen at random when the Bean begins execution.
A public method can be invoked to change it
Each time the mouse is clicked on the Bean, another random color is
chosen.
There is one boolean read/write property that determines the shape.
The BDK is used to lay out an application with one instance of the Colors
Bean and one instance of the OurButton Bean.
The button is labeled “Change.” Each time it is pressed, the color
changes.
20.
21. Create a New Bean
Here are the steps that you must follow to create a new Bean:
1. Create a directory for the new Bean.
2. Create the Java source file(s).
3. Compile the source file(s).
4. Create a manifest file.
5. Generate a JAR file.
6. Start the BDK.
7. Test.
22. 1.Create a Directory for the New Bean
You need to make a directory for the Bean. To follow along with this example, create
c:bdkdemosunwdemocolors. Then change to that directory.
2.Create the Source File for the New Bean
The package statement at the beginning of the file places it in the package named
sunw.demo.colors.
The color of the component is determined by the private Color variable color, and
its shape is determined by the private boolean variable rectangular.
The constructor defines an anonymous inner class that extends MouseAdapter and
overrides its mousePressed( ) method.
The change( ) method is invoked in response to mouse presses. The component is
initialized to a rectangular shape of 200 by 100 pixels.
The change( ) method is invoked to select a random color and repaint the
component.
The getRectangular( ) and setRectangular( ) methods provide access to the one
property of this Bean.
The change( ) method calls randomColor( ) to choose a color and then calls repaint( )
to make the change visible.
Notice that the paint( ) method uses the rectangular and color variables to determine
how to present the Bean.
23. 3.Compile the Source Code for the New Bean
Compile the source code to create a class file. Type the following:
javac Colors.java.
4.Create a Manifest File
You must now create a manifest file. First, switch to the c:bdkdemo directory. This
is the directory in which the manifest files for the BDK demos are located. Put the
source code for your manifest file in the file colors.mft. It is shown here:
Name: sunw/demo/colors/Colors.class
Java-Bean: True
This file indicates that there is one .class file in the JAR file and that it is a Java
Bean.
Notice that the Colors.class file is in the package sunw.demo.colors and in the
subdirectory sunwdemocolors relative to the current directory.
24. 5.Generate a JAR File
Beans are included in the ToolBox window of the BDK only if they are in JAR files in the
directory c:bdkjars. These files are generated with the jar utility. Enter the
following:
jar cfm ..jarscolors.jar colors.mft sunwdemocolors*.class
This command creates the file colors.jar and places it in the directory c:bdkjars.
(You may wish to put this in a batch file for future use.)
6. Start the BDK
Change to the directory c:bdkbeanbox and type run. This causes the BDK to start.
You should see three windows, titled ToolBox, BeanBox, and Properties. The ToolBox
window should include an entry labeled “Colors” for your new Bean.
25. Create an Instance of the Colors Bean
After you complete the preceding steps, create an instance of the Colors Bean in the
BeanBox window.
Test your new component by pressing the mouse anywhere within
its borders. Its color immediately changes.
Use the Properties window to change the
rectangular property from false to true. Its shape immediately changes.
26. Create and Configure an Instance of the OurButton Bean
Create an instance of the OurButton Bean in the BeanBox window. Then follow
these steps:
1. Go to the Properties window and change the label of the Bean to “Change”.
You should see that the button appearance changes immediately when this
property is changed.
2. Go to the menu bar of the BeanBox and select Edit | Events | action |actionPerformed.
3. Move the cursor so that it is inside the Colors Bean display area, and click the
L eft mouse button. You should see the Event Target Dialog dialog box.
4. The dialog box allows you to choose a method that should be invoked when
this button is clicked. Select the entry labeled “change” and click the OK button.
You should see a message box appear very briefly, stating that the tool is
“Generating and compiling adaptor class.”
5. Click on the button. You should see the color change.
27. Using Bound Properties
A Bean that has a bound property generates an event when the property is changed.
The event is of type PropertyChangeEvent and is sent to objects that previously
registered an interest in receiving such notifications.
The TickTock Bean is supplied with the BDK. It generates a property change event
every N seconds. N is a property of the Bean that can be changed via the Properties
window of the BDK. The next example builds an application that uses the TickTock
Bean to automatically control the Colors Bean.
Steps
For this example, start the BDK and create an instance of the Colors Bean in the
BeanBox window.
Create an instance of the TickTock Bean.
The Properties window should show one property for this component.
It is “Interval” and its initial value is 5.
This represents the number of seconds that elapse between property change events
generated by the TickTock Bean.
Change the value to 1.
28.
29. Now you need to map events generated by the TickTock Bean into method calls on
the Colors Bean.
Follow these steps:
1. Go to the menu bar of the BeanBox and select Edit | Events | propertyChange |
propertyChange.
You should now see a line extending from the button to the cursor.
2. Move the cursor so that it is inside the Colors Bean display area, and click the
left mouse button. You should see the Event Target Dialog dialog box.
3. The dialog box allows you to choose a method that should be invoked when this event
occurs. Select the entry labeled “change” and click the OK button.
You should see a message box appear very briefly, stating that the tool is
“Generating and compiling adaptor class.”
You should now see the color of your component change every second.
30. Using the BeanInfo Interface
In our previous examples, design patterns were used to
determine the information that was provided to a Bean user.
This section describes how a developer can use the
BeanInfo interface to explicitly control this process.
This interface defines several methods, including these:
PropertyDescriptor[ ] getPropertyDescriptors( )
EventSetDescriptor[ ] getEventSetDescriptors( )
MethodDescriptor[ ] getMethodDescriptors( )
They return arrays of objects that provide information about the
properties, events, and methods of a Bean. By implementing
these methods, a developer can designate exactly
what is presented to a user.
31. SimpleBeanInfo is a class that provides default implementations of the BeanInfo
interface, including the three methods just shown.
You may extend this class and override one or more of them. The following listing shows
how this is done for the Colors Bean that was developed earlier.
ColorsBeanInfo is a subclass of SimpleBeanInfo.
It overrides getPropertyDescriptors( ) in order to designate which properties are
presented to a Bean user.
This method creates a PropertyDescriptor object for the rectangular property.
The PropertyDescriptor constructor that is used is shown here:
PropertyDescriptor(String property, Class beanCls) throws IntrospectionException
Here, the first argument is the name of the property, and the second argument is the
class of the Bean.
32. // A Bean information class.
package sunw.demo.colors;
import java.beans.*;
public class ColorsBeanInfo extends SimpleBeanInfo
{
public PropertyDescriptor[] getPropertyDescriptors()
{
try {
PropertyDescriptor rectangular = new
PropertyDescriptor("rectangular", Colors.class);
PropertyDescriptor pd[] = {rectangular};
return pd;
}
catch(Exception e) {}
return null;
}
}
33. You must compile this file from the BDKdemo directory or set CLASSPATH so
that it includes c:bdkdemo. If you don’t, the compiler won’t find the Colors.class
file properly.
After this file is successfully compiled, the colors.mft file can be updated,as shown
here:
Name: sunw/demo/colors/ColorsBeanInfo.class
Name: sunw/demo/colors/Colors.class
Java-Bean: True
Use the JAR tool to create a new colors.jar file. Restart the BDK and create an
instance of the Colors Bean in the BeanBox.
34.
35. Constrained Properties
A Bean that has a constrained property generates an event when an attempt is
made to change its value.
The event is of type PropertyChangeEvent. It is sent to objects that
previously registered an interest in receiving such notifications.
Those other objects have the ability to veto the proposed change. This
capability allows a Bean to operate differently according to its run-time
environment
36. Persistence
Persistence is the ability to save a Bean to nonvolatile storage and retrieve it at a
later time. The information that is particularly important are the configuration
settings.
Let us first see how the BDK allows you to save a set of Beans that have been
configured and connected together to form an application.
Recall our previous example involving both the Colors and TickTock Beans. The
rectangular property of the Colors Bean was changed to true, and the interval
property of the TickTock Bean was changed to one second. These changes can
be saved.
To save the application, go to the menu bar of the BeanBox and select File | Save.
A dialog box should appear, allowing you to specify the name of a file to which the
Beans and their configuration parameters should be saved. Supply a filename and
click the OK button on that dialog box. Exit from the BDK.
Start the BDK again. To restore the application, go to the menu bar of the BeanBox
and select File | Load. A dialog box should appear, allowing you to specify the name
of the file from which an application should be restored. Supply the name of the file
in which the application was saved, and click the OK button. Your application
should now be functioning. Confirm that the rectangular property of the Colors
Bean is true and that the interval property for the TickTock Bean is equal to
one second.
37. The object serialization capabilities provided by the Java class libraries are
used to provide persistence for Beans. If a Bean inherits directly or indirectly
from java.awt.Component, it is automatically serializable, because that
class implements the java.io.Serializable interface. If a Bean does not
inherit an implementation of the Serializable interface, you must provide
this yourself. Otherwise, containers cannot save the configuration of your
component.
The transient keyword can be used to designate data members of a Bean
that should not be serialized. The color variable of the Colors class is an
example of such an item.
38. Customizers
The Properties window of the BDK allows a developer to modify the
properties of a Bean.
However, this may not be the best user interface for a complex component
with many interrelated properties.
Therefore, a Bean developer can provide a customizer that helps another
developer configure this software.
A customizer can provide a step-by-step guide through the process that must
be followed to use the component in a specific context.
Online documentation can also be provided. A Bean developer has great
flexibility to develop a customizer that can differentiate his or her product in the
marketplace.
39. The Java Beans API
The Java Beans functionality is provided by a set of classes and interfaces in
the java.beans package.
Interface Decription
AppletInitializer Methods in this interface are used to Initialize Beans that are
also applets.
BeanInfo This interface allows a designer to specify information about the
properties, events, and methods of a Bean.
Customizer This interface allows a designer to provide a graphical user
interface through which a Bean may be configured.
DesignMode Methods in this interface determine if a Bean is executing in
design mode.
ExceptionListener A method in this interface is invoked when an exception has
occurred. (Added by Java 2, version 1.4.)
PropertyChangeListener A method in this interface is invoked when a bound property is
changed.
PropertyEditor Objects that implement this interface allow designers to change
and display property values.
VetoableChangeListener A method in this interface is invoked when a constrained
40. The Java Beans API
Class Decription
BeanDescriptor This class provides information about a Bean.It also allows you to
associate a customizer with a Bean.
Beans This class is used to obtain information abouta Bean.
Encoder Encodes the state of a set of Beans. Can be used to write this
information to a stream.
EventHandler Supports dynamic event listener creation.
EventSetDescriptor Instances of this class describe an event that can be generated by a
Bean.
IndexedPropertyDescriptor Instances of this class describe an indexed property of a Bean.
IntrospectionException An exception of this type is generated if a problem occurs when
analyzing a Bean.
Introspector This class analyzes a Bean and constructs a BeanInfo object that
describes the component.
MethodDescriptor Instances of this class describe a method of a Bean.
ParameterDescriptor Instances of this class describe a method parameter.
41. JAR FILES
A JAR file allows you to efficiently deploy a set of classes and their associated
Resources.
For example, a developer may build a multimedia application that uses various
sound and image files. A set of Beans can control how and when this information is
presented. All of these pieces can be placed into one JAR file.
the elements in a JAR file are compressed, which makes downloading a JAR file
much faster than separately downloading several uncompressed files.
• jar is part of the jdk
• jar {ctx} [vfm0M] [jar-file] [manifest-file] files …
• jar cfm SimpleBean.jar manifest.tmp SimpleBean.class
42. Option Description
c A new archive is to be created.
C Change directories during command execution.
f The first element in the file list is the name of the archive that is to
be created or accessed.
i Index information should be provided.
m The second element in the file list is the name of the external
manifest file.
M Manifest file not created.
t The archive contents should be tabulated.
u Update existing JAR file.
v Verbose output should be provided by the utility as it executes.
x Files are to be extracted from the archive.
0 Do not use compression.
43. Creating a JAR File
The following command creates a JAR file named Xyz.jar that contains all of
the .class and .gif files in the current directory:
jar cf Xyz.jar *.class *.gif
If a manifest file such as Yxz.mf is available, it can be used with the following
command:
jar cfm Xyz.jar Yxz.mf *.class *.gif
Tabulating the Contents of a JAR File
The following command lists the contents of Xyz.jar:
jar tf Xyz.jar
Extracting Files from a JAR File
The following command extracts the contents of Xyz.jar and places those files
in the current directory:
jar xf Xyz.jar
44. Updating an Existing JAR File
The following command adds the file file1.class to Xyz.jar:
jar -uf Xyz.jar file1.class
Manifest File
•Describes entries in jar archive
• Made up of attribute/value pairs
• Format is “attribute: value”
Name: SimpleBean.class
Java-Bean: True