The Java Tutorials' Weblog
Java Tutorial Update
We have just pushed an updated version of the Java Tutorial to the web to coincide with the release of Java 6 Update 18.This update to the tutorial features some additions and an update to the Deployment trail:
- Developing Draggable Applets – a new topic describing how to create an applet that can be dragged outside of a browser and dynamically converted into a Java Web Start application.
- Sending Messages to Other Applets has been rewritten.
- Deploying Without the Codebase Attribute – a new section describing how to use functions in the Deployment Toolkit script to develop and test Java Web Start applications without specifying the codebase attribute in the application's Java Network Launch Protocol (JNLP) file. The ability to deploy and launch Java Web Start applications without specifying the codebase attribute is introduced in the Java SE 6 Update 18 release.
project.xml file was patched. This problem is fixed.
Thanks, as always, for your feedback.
- Sharon Zakhour
Posted at 10:38AM Jan 12, 2010 by The Java Tutorial Team | Comments[0]
Java Applets Quiz
Do you enjoy quizzes? Take a minute to answer this quiz about Java applets.[Read More]Posted at 01:29PM Nov 25, 2009 by The Java Tutorial Team | Comments[2]
Getting Applets To Talk To Each Other
Do you have more than one applet on a web page? Do you want the applets to share water cooler gossip? Ahem..ahem.. On a more serious note, do you want one applet to invoke methods or set variables of another applet? [Read More]Posted at 10:06AM Nov 24, 2009 by The Java Tutorial Team | Comments[0]
Reader Poll: Who Wants Screencasts?
Hi everyone,We're running a reader poll over on the JavaFX blog. We'd like to know your thoughts on screencasting vs. written tutorials. Please take a minute to visit that page and leave a comment. We greatly value your opinion!
- Scott Hommel
Posted at 08:06AM Nov 17, 2009 by The Java Tutorial Team | Comments[5]
Re-spin Your Desktop Application Into A Java Web Start Application
Do you have a desktop application that you'd like to distribute to a wider audience? How about monetizing your application by showcasing it on the Java Store? Check out our screencast!
[Read More]Posted at 03:17PM Nov 13, 2009 by The Java Tutorial Team | Comments[2]
NetBeans and the Swing Examples in The Java Tutorial
Several years ago we converted the 100+ examples in the Swing Tutorial to NetBeans projects. We have received several reports of people having trouble opening those NetBeans projects and we have learned that, as of NetBeans 6.5, a tag is now required in theproject.xml file, even if that tag is empty.
We are working on updating those examples but, until that happens, you have to manually add the following tag to your project.xml file, before the </data> tag:
<test-roots/>
For example, the corrected project.xml file for the TableFilterDemoProject example would read:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>TableFilterDemo</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots/> <!-- ADDED -->
</data>
</configuration>
</project>
Thanks for your patience until we fix this problem and thanks, as always, for reading the Java Tutorials.
-- Sharon Zakhour
Posted at 09:34AM Nov 11, 2009 by The Java Tutorial Team | Comments[0]
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[7]
Tuesday Jan 12, 2010