| You are receiving this e-mail {e-mail address} because you elected to receive e-mail from Sun Microsystems, Inc. To update your communications preferences, please see the link at the bottom of this message. We respect your privacy and post our privacy policy prominently on our Web site http://sun.com/privacy/ |
![]() |
||||||
|
||||||
|
This monthly newsletter provides a way for you to learn the basics of
the Java programming language, discover new resources, and keep
up-to-date on the latest additions to Sun Developer Network's New to
Java Programming Center.
You can receive future issues of this newsletter in HTML or text: http://developer.java.sun.com/subscription/ Note: For the code to compile in this issue of Fundamentals, you need to use the JDK 5.0 software. http://java.sun.com/j2se/1.5.0/download.jsp |
||
| Contents | ||
| Java Programming Language Basics | ||
| Making Sense of the Java Classes & Tools | ||
|
New Java 2D Features in J2SE 5.0 Caching All BufferedImages As of J2SE 5.0, all images created with a BufferedImage constructor
are managed images and can be cached in video memory or, in the case
of a remote X server, on the X server side. Previously, the Sun
implementation managed only compatible images -- those created with
the Component createImage(int, int)method or with the
GraphicsConfiguration createCompatibleImage methods. Managed images
generally perform better than unmanaged images.
Methods for Controlling Hardware Acceleration of Images The bug report that corresponds to this change is 4881082. The Image class has three new methods related to hardware acceleration. The getCapabilities method, formerly defined only in
VolatileImage, allows you to determine whether the image is
currently accelerated. Two other methods let you set or get a hint
about how important acceleration is for the image:
setAccelerationPriority and getAccelerationPriority.
The GraphicsConfiguration class has two new methods, createCompatibleVolatileImage(int, int, int) and
createCompatibleVolatileImage(int, int, ImageCapabilities, int),
that allow you to create transparent VolatileImages.
Note: In J2SE 5.0, these methods are not fully operational. The value set by setAccelerationPriority is ignored, and images created with the createCompatibleVolatileImage methods are not
always hardware accelerated. On Linux and Solaris systems, only
OPAQUE VolatileImages are hardware accelerated. On Microsoft
Windows systems, images created with
createCompatibleVolatileImage in J2SE 5.0 are hardware
accelerated only if the hardware supports acceleration and one
of the following is true:
sun.java2d.translaccel=true).Read more Lesson: Regular Expressions What are regular expressions? Regular expressions are a way to describe a set of strings based on common characteristics shared by each string in the set. They can be used as a tool to search, edit, or manipulate text or data. You must learn a specific syntax to create regular expressions -- one that goes beyond the normal syntax of the Java programming language. Regular expressions range from being simple to quite complex, but once you understand the basics of how they're constructed, you'll be able to understand any regular expression. This tutorial will teach you the regular expression syntax supported by the java.util.regex API (in the API reference documentation), and it will present plenty of working examples to illustrate how the various objects interact. In the world of regular expressions, there are many different flavors to choose from, such as grep, Perl, Tcl, Python, PHP, and awk. The regular expressions in the java.util.regex API are most similar to Perl. How are regular expressions represented in this package? The java.util.regex package consists of three classes, all in the
API reference documentation: Pattern, Matcher, and
PatternSyntaxException.
In the last few sections in this lesson, we'll explore each class in detail with a separate section devoted to each class. But first, let's learn the details of how regular expressions are created. The next section introduces a simple test harness that we'll use repeatedly to explore how regular expressions are constructed. Read more |
||
| Java Bits | ||
|
J2SE SDK/JRE Version String Naming Convention Developers may need to know a product's version string for various purposes, depending on whether they are developing and deploying a product or downloading and integrating a product. The following table explains how to interpret SDK/JRE release version string information. Note that this convention was not in effect prior to the 1.3.0 feature release. The output of java -version has had the same format since 1.3.1 system properties and the java -version command. The output of the java -version command includes a product version identifier and a build identifier. This output is determined by the values of several system properties, and those system properties can themselves be examined programmatically at runtime. Read more |
||
| Using Assertions in Java Technology by Qusay H. Mahmoud | ||
|
Finding bugs in programs is not an easy task, especially when they are subtle bugs. The process of finding bugs is not exciting, and you may have gone through your program wasting your time trying to find bugs that should not have existed in the first place. Such bugs may exist because you did not understand the specifications correctly. And as Barry Boehm, the father of software economics, put it: If it costs $1 to find and fix a requirement-based problem during the requirements definition process, it can cost $5 to repair it during design, $10 during coding, $20 during unit testing, and as much as $200 after delivery of the system. Thus, finding bugs early on in the software life cycle pays off. You can use assertions to detect errors that may otherwise go unnoticed. Assertions contain Boolean expressions that define the correct state of your program at specific points in the program source code. The designers of the Java platform, however, didn't include support for assertions. Perhaps they viewed exceptions as a superior feature, allowing you to use try/catch/finally to throw an exception instead of aborting the program as in assertions. But the Java 2 Platform, Standard Edition (J2SE) release 1.4, has introduced a built-in assertion facility. This article does the following:
|
||
| What's New on java.net | ||
|
Pixel Pushing by Jonathan Simon Building a graphical interface is hyperdetailed, laborious work. A server-side or nongraphical component can usually get by by fixing an interface that needs a little reworking "in the next release." Graphical interfaces simply don't have that option. This is because any detail left unattended is displayed in plain sight to the users of our applications. Adjacent borders, buttons, and text have to line up to the pixel -- otherwise, the interface simply looks sloppy. And we, as graphical interface developers, need to strive to make interfaces that don't look sloppy. With that in mind, we are going to focus on the nitty-gritty, pixel- level details of a graphical interface. In this article, we'll copy a native operating system icon in Java technology code and explore some tools and processes that can help you get used to working in the pixel-pushing world. Read the rest of this article |
||
| Sun's Java Technology Instructor-Led Courses | ||
|
Java Sun CAP for OO Programmers Preparing to Become a Sun Certified Programmer (PK-CERT-JA1B) The PK-CERT-JA1B CAP is for Object-Oriented programmers preparing to become a Sun Certified Programmer for the Java 2 Platform, Standard Edition. Learn more about this course |
||
| Sun's Java Technology Exams | ||
|
Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 (CX-310-055) The Sun Certified Programmer for Java 2 Platform 5.0 certification exam is for programmers experienced in using the Java programming language. Achieving this certification provides clear evidence that a programmer understands the basic syntax and structure of the Java programming language and can create Java technology applications that run on server and desktop systems using J2SE 5.0. Learn more |
||
| Books for Learning | ||
|
The Java Language Specification Written by the inventors of the technology, The "Java Language Specification, Third Edition," is the definitive technical reference for the Java programming language. If you want to know the precise meaning of the language's constructs, this is the source for you. The book provides complete, accurate, and detailed coverage of the Java programming language. It provides full coverage of all new features added since the previous edition, including generics, annotations, asserts, autoboxing, enums, for each loops, and static import clauses. More information |
||
| For More Information | ||
|
||
| Downloading the Java 2 Platform, Standard Edition (J2SE) | ||
|
For most Java development, you need the class libraries, compiler, tools, and runtime environment provided with the J2SE development kit. |
||
|
Comments? Send your feedback on the Java Technology Fundamentals Newsletter to: fundamentals_newsletter@sun.com
Find archived issues of the following Java technology developer newsletters or manage your current newsletter subscriptions: https://softwarereg.sun.com/registration/developer/en_US/subscriptions Subscribe to the following newsletters for the latest information about technologies and products in other Java platforms:
IMPORTANT: Please read our Terms of Use, Privacy, and Licensing policies: http://www.sun.com/share/text/termsofuse.html http://www.sun.com/privacy/ http://developer.java.sun.com/berkeley_license.html © 2005 Sun Microsystems, Inc. All Rights Reserved. For information on Sun's trademarks see: http://sun.com/suntrademarks Java, J2EE, J2SE, J2ME, and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. To update your Sun subscription preferences or unsubscribe to Sun news services, click here or use this link https://softwarereg.sun.com/registration/developer/en_US/subscriptions Sun Microsystems, Inc. 10 Network Circle, MPK10-209 Menlo Park, CA 94025 US |