The Java Tutorials' Weblog
Update -- Mixing Heavyweight and Lightweight Components article
On Sept 23rd, I posted about a new article that describes how you can easily mix heavyweight and lightweight components in 6u12 and JDK7. The calculator example included with the article tickled a known bug on some systems.The example has now been updated with the recommended workaround. Also, the text of the article calls out the workaround (see the first bullet under the Requirements section).
Thanks, as always, for your feedback!
-- Sharon Zakhour
Posted at 04:16PM Oct 12, 2009 by The Java Tutorial Team | Comments[0]
Blogs About Developing and Deploying RIAs
Blogs About Developing and Deploying RIAs[Read More]Posted at 02:55PM Sep 30, 2009 by The Java Tutorial Team | Comments[0]
Mixing Heavyweight and Lightweight Components

java.awt.Button or a java.awt.Label, in a window that has a lightweight component (for example, a javax.swing.JMenu)? Where the menu overlaps the button (or label), the lightweight menu appears underneath the heavyweight component.
But, as of 6u12 and JDK7 build 19, this now "just works." For more information, see the new article Mixing Heavyweight and Lightweight Components.

- Sharon Zakhour
Posted at 02:35PM Sep 23, 2009 by The Java Tutorial Team | Comments[1]
Java Tutorial Update
We have just pushed an updated version of the Java Tutorial to the web. This update features:- A Deployment tutorial that covers a wide range of topics about the development and deployment of rich Internet applications. The Deployment tutorial contains the following lessons:
- A new section in the Swing look and feel lesson showing how to use the new Nimbus look and feel.
- A new Swing page describing How to Create Translucent and Shaped Windows.
- A new Interfaces and Inheritance page discussing Polymorphism.
- As always, we have fixed numerous bugs, typos and broken links.
Please let us know what you think!
- Sharon Zakhour
Posted at 07:40PM Sep 22, 2009 by The Java Tutorial Team | Comments[2]
Follow Scott on Twitter!
Hey everyone, this is Scott Hommel. I've been a member of the docs team here at Sun for the past decade, working on both the JDK docs and the Java Tutorial. Since '07 I've been assigned exclusively to JavaFX (http://www.javafx.com). I've set up a twitter account at http://www.twitter.com/scotthommel so if you've ever been curious about the day-to-day workings of a technical writer, sign up to "follow" what I'm working on. It'll give you the inside scoop on what docs are coming out next. With enough followers, perhaps other writers will start "tweeting" as well.-- Scott Hommel
Posted at 02:26PM Sep 09, 2009 by The Java Tutorial Team | Comments[3]
Translucent and Shaped Windows in JDK7
Learn how to add translucent and shaped windows to your Swing applications.[Read More]Posted at 01:08PM Aug 13, 2009 by The Java Tutorial Team | Comments[3]
NIO.2 Updates in JDK7
If you are already using the new file I/O API provided in JDK7, you should be aware that there are some minor API changes as of build 64. If you are using the JavaOne Preview release, the changes have not yet been integrated, but they are available now on java.net.The API is changed as follows:
Path.delete(boolean)is nowPath.deleteIfExists(). So,delete(true)is equivalent todelete(), anddelete(false)is equivalent todeleteIfExists().- The time stamp methods in the
Attributeclass that tooklong, TimeUnitarguments now take an instance of the newFileTimeclass. Similarly, theBasicFileAttributestime stamp methods now return an instance of FileTime. The new method signatures are:Attributes.setLastAccessTime(FileRef, FileTime)Attributes.setLastModifiedTime(FileRef, FileTime)FileTime creationTime()inBasicFileAttributesFileTime lastAccessTime()inBasicFileAttributesFileTime lastModifiedTime()inBasicFileAttributes
- The
BasicFileAttribute.linkCount()method has been removed. - The
BasicFileAttribute.resolution()method has been removed.
The File I/O lesson in the Java Tutorials has been updated with the new API.
-- Sharon Zakhour
Posted at 09:39AM Jul 25, 2009 by The Java Tutorial Team | Comments[2]
Deploying Your Rich Internet Application Nice And Easy!
Learn techniques to deploy rich internet applications that start up quickly and run consistently in all environments. This blog is based (mostly) on Thomas Ng's Java One Presentation - "Deploying Java Technologies To The Masses".[Read More]Posted at 08:00PM Jun 02, 2009 by The Java Tutorial Team | Comments[0]
Just released -- Java Tutorials update
To coincide with the JDK7 Preview Release and JavaOne, we have just published an updated version of the Java Tutorials. Besides fixing many typos and errors that you have reported, this release includes:
- An entirely reworked File I/O lesson, featuring NIO.2. This functionality is part of JDK7, which is available now through the Open JDK a> project on java.net.
- A new specialized trail covering Sockets Direct Protocol, also new in JDK7.
- A new facility for gathering feedback about the tutorial. At the bottom of each tutorial page, under the "Discuss" heading, you can leave a publicly viewable, blog-style comment. Let us know what you think about the inclusion of this JS-Kit mechanism.
Thanks, as always, for your feedback. It helps us improve the tutorial!
-- Sharon Zakhour
Posted at 10:09AM May 27, 2009 by The Java Tutorial Team | Comments[6]
Watching A Directory for Changes — File Change Notification in NIO.2
The NIO.2 API can be used to write a program that watches a file or directory and notifies the application when the file has changed.[Read More]Posted at 07:22PM May 13, 2009 by The Java Tutorial Team | Comments[12]
Deployment Toolkit 101
The Deployment Toolkit is a set of JavaScript functions that can help developers easily deploy rich internet applications. [Read More]Posted at 02:40PM Apr 02, 2009 by The Java Tutorial Team | Comments[6]
Converting Pre-JDK7 File I/O Code
Prior to JDK7, thejava.io.File class was the mechanism used for
file I/O, but it had several drawbacks. Perhaps you have legacy code that uses java.io.File
and would like to take advantage of the java.nio.file.Path functionality
with minimal impact on your code.[Read More]
Posted at 04:08PM Apr 01, 2009 by The Java Tutorial Team | Comments[3]
Deploying An Applet In Under 10 Minutes
Want to learn how to quickly deploy a Java applet?[Read More]Posted at 10:11PM Mar 31, 2009 by The Java Tutorial Team | Comments[16]
PathMatcher in NIO.2
In my last blog entry I show how to walk a file tree using aFileVisitor in a very simple Find example. Alan Bateman (the NIO.2 czar) suggested that, rather than use java.lang.String to match the file, I use the new PathMatcher API.
[Read More]
Posted at 06:28AM Mar 27, 2009 by The Java Tutorial Team | Comments[1]
Traversing a file tree in NIO.2
Have you downloaded JDK7 and played with NIO.2 yet? NIO.2 offers many new I/O features, particularly in the area of files and file system APIs. [Read More]Posted at 09:47AM Mar 24, 2009 by The Java Tutorial Team | Comments[4]
Monday Oct 12, 2009