★ wanayoo — archive 1999 http://developer.java.sun.com/developer/technicalArticles/RoadMaps/Text/index.htmlNouvelle recherche | Portail wanayoo
Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Technical Articles

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
Articles Index

JDKTM 1.2 Roadmap: Text and Related Tutorials

Monica Pawlan

Most applications use text in one form or another, and the JavaTM Development Kit (JDK) 1.2 APIs provide a wide range of classes and packages to display, edit, internationalize, and otherwise handle text in applications.

The APIs encompass everything from simple text string and character handling, to foreign language support and stylized graphical text.

You might not design anything as elaborate as this illuminated manuscript from Renaissance France (follow the link to see others), but the JDK 1.2 APIs, especially Java 2D, provide what you would need to do something similar.

This page presents an overview of JDK 1.2 text classes and packages, and links to tutorials where you can learn more.

What is Application Text?

Application text is any writing that appears in the user interface or any application-related files the end user can see. It can be editable, static, or graphical, and is used to present things like labels, dates, the time, numbers, messages, and system properties to the end user. Application text also includes user-supplied or application-generated text.

The Java platform provides the following rich assortment of packages and classes for handling text in all its many forms in applications. All JDK 1.2 text classs support the The Unicode Standard--a global character coding system for handling diverse modern, classical, and historical languages.

  • The java.lang package provides String and Character classes for basic string and character manipulation.

  • The java.util package implements text-related classes for handling dates, time, string parsing, system properties, and localization.

  • The java.text package implements classes and interfaces for internationalizing a Java application.

  • The com.sun.java.swing package includes text packages to support editable and static text components (com.sun.java.swing.text), and to create HTML or rich-text-format (RTF) text editors (com.sun.java.swing.text.html and com.sun.java.swing.text.rtf).

  • The java.awt package provides component classes for displaying static and editable text.

  • The java.awt.Font class and java.awt.font package provide sophisticated text styling capabilities for stylized graphical text.

Where Are the Tutorials?

You can go on to the tutorials listed here for more information on how to use the various JDK 1.2 text packages and classes in your applications.

Internationalization

You will find a tutorial for the Internationalization and localization APIs in the The Java Tutorial. These APIs let you design an application so it can be adapted to different languages and regions without recompilation. The design process is called internationalization, and the addition of locale-specific components and the translation of text is called localization.

The textual data such as messages and GUI component labels, and other culturally-dependent data such as dates and currencies are isolated from the rest of the application in sets of files where one set contains the text for a given language and region. For example, there might be a set of files for French and another set for Canadian French, and because the language code is specified at run time, the same application can be distributed to Canada and France with no modifications to the executable code. By isolating the text to be translated, you also save translation costs.

Swing

The JTextComponent class and its descendants implement the editable text components in Swing. Its descendants support plain or styled text with text editing, hit detection, and selection highlighting highlighting support. All Swing text components support the unicode character set and can display and handle international languages.

Read How to Use Text Components and How to Use Text Fields in the The Java Tutorial.

Note: The Swing tutorials are a work in progress.

Abstract Window Toolkit (AWT)

The java.awt package supports text-oriented components, graphical text, and stylized text. Of these, only stylized text supports hit detection, selection highlighting, and foreign languages.

Monica Pawlan is a staff writer on the JDC team. She has a background in 2D and 3D graphics, security, database products, and loves to explore emerging technologies.

monica.pawlan@eng.sun.com


Reader Feedback

Tell us what you think of this article.

Very worth reading Worth reading Not worth reading

If you have other comments or ideas for future articles, please type them here:


[ This page was updated: 28-Sep-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.