List of Articles

Additional Insight Into Java 1.2

In last article we have seen security enhancement features of Java. Today we will discuss following additional features of Java Foundation Classes.

Before we talk about new features let us understand what is JFC. These are the classes which gives you number of objects which are required for application or applet development. e.g. If a simple screen like login has to be created, then we need ways to create a Label, a Textbox, a Button and a Window as a container to all these objects. Now we are not going to start our programming write from how a label works. All these objects are given to us in terms of classes and we are just supposed to create instance of these classes and use the functionality.

In JFC additional features, one major feature is SWING.

Swing

Swing is a new set of GUI components with a "Pluggable look and feel" that are implemented in 100% Pure Java initiative, and based on the JDK 1.1 Lightweight UI Framework. Pluggable Look and Feel lets you easily assign an OS-specific look & feel (Motif, Microsoft Windows, MacOS) or a uniform look & feel to your Swing GUI components. Additionally, you can modify an existing look & feel or create your own.

Swing Components include both 100% Pure Java versions of the 1.1 AWT component set, plus a rich set of higher level components. The complete set includes borders, buttons, checkboxes, combo boxes, icons, labels, lists, list boxes, menus, menubars, menu items, popup menus, radio buttons, progress bars, scroll panes & viewports, scrollbars, tabbed panes, tables, text areas, text components, text fields, trees and HTML viewers. Accessibility is built-in to Swing components. All Swing components implement the Java Accessibility API. Mouseless operation support is built

into the Swing components. All Swing components can be operated entirely from the keyboard.

While working on Application development, we will work on swing in detail.

 Java 2D

Java 2D API is a set of classes for advanced 2D graphics and imaging. It encompasses line art, text, and images in a single comprehensive model. The API provides extensive support for image compositing and alpha channel images, a set of classes to provide accurate color space definition and conversion, and a rich set of display-oriented imaging operators. These classes are provided as additions to the java.awt and java.awt.image packages (rather than as a separate package).

 Accessibility

Accessibility API provides a clean interface which allows assistive technologies to interact and communicate with JFC and AWT components. Assistive technologies are used by people with and without disabilities and include screen readers, screen magnifiers, speech recognition, and keyboard support for mouseless use. All Swing components implement this API.

Drag & Drop

Drag & Drop enables data transfer both across native applications and applications written in the Java programming language, between Java applications, and within a single Java application.

Application Services

Keyboard Navigation makes it possible to substitute the pressing of predetermined key combinations for mouse-driven events such as the selection of a menu item or a dialog-box button. Multithreaded Event Queue is an enhanced event queue that makes it easier for developers to synchronize events from multiple sources. This simplifies thread management by making use of new methods such as invokeLater(), which makes it possible for an application to access the user interface from a separate thread. Custom Cursors allow programs to create their own custom mouse cursors using arbitrary images. The hotspot can also be defined. Debug Graphics Utility is a design tool that you can use to test whether your Swing components are being drawn correctly. With DebugGraphics, you can highlight component parts in bright red as they are being drawn. Then you can monitor them as they are being created and observe exactly how all drawing operations are taking place.

Repaint Batching is a mechanism that provides ways to optimize the repainting of screen regions. It lets you mark a component region as out-of-date, and compute the intersection of all out-of-date regions and repaint what is appropriate. It also provides a way for objects to be aware of all out-of-date regions in a component hierarchy at a given time so advanced optimization will be possible. Lastly, it allows you to plug in a custom repaint batching system for special applications.

Author Mrs. Vaishali Tapaswi is Director, Fands Infotrainers. For additional Information on Java features she can be reached at vaishali@fandsindia.com