New and Noteworthy
This chapter lists high-profile features in these releases.
Deactivating J2SE 1.4.2 on OS X v10.5
Apple's support of J2SE 1.4.2 has been deprecated since OS X v10.5 was released in October 2007. Sun Microsystems officially completed the End of Life transition for J2SE 1.4.2 on October 30th, 2008 (see http://java.sun.com/j2se/1.4.2/ for more information).
Java for OS X v10.5 Update 6 disables the existing J2SE 1.4.2 installation on OS X v10.5. No further security or bug fixes are planned for J2SE 1.4.2. If you still require 1.4.2 for backwards compatibility with older applications, it can be reactivated with Java Preferences, but this is not recommended. Instead, please file bugs with specific details of the compatibility issues that require you to re-enable 1.4.2.
EAWT Default Menu Bar
The com.apple.eawt.Application class now has a setDefaultMenuBar(JMenuBar)
method that sets a default menu bar in your application when no other Frames are open. This feature requires your application to use both the Aqua Look and Feel and the apple.laf.useScreenMenuBar=true
property to hook up the native menu bar delegates correctly. This long-requested feature should remove the need to create an invisible or offscreen window to simulate the appearance of a true "default" menu bar.
EAWT Application Attention Request
The com.apple.eawt.Application class now has a requestUserAttention(boolean)
method which will bounce the application's Dock icon if the application is in the background. If the application is already in the foreground, nothing will happen. There is also a new requestForeground(boolean)
method that will request that one or all of the application's windows come to the foreground.
EIO Reveal in Finder and Move to Trash
The com.apple.eio.FileManager class now has two new desktop interaction methods, revealInFinder(File)
and moveToTrash(File)
. You can use revealInFinder()
to open a Finder window in the parent directory of a file and select it. You can use moveToTrash()
to move a file to the most appropriate Trash directory for the volume that contains that file.
JPopupMenus and Round Corners
JPopupMenus, JComboBox popups, and in-window menu bar popups now have round corners which match the appearance of native popup menus. Your application may inadvertently disable the new round corners in some cases. For example, if you install custom components in a popup menu, any drawing that occurs over the corners will square them off. Installing components in the corners that perform no drawing will allow the popup corners to be rounded. Also, rounded corners will be disabled if you install a custom popup factory.
Search JTextFields and Prompting Text
You can now show grey "prompt" text in JTextFields marked with a JTextField.variant
client property of search
. This prompting text will show up when there is no user-entered value in the search field. Simply set the value of the JTextField.Search.Prompt
client property to the string you want to display by default. See New Control Styles available within J2SE 5.0 on Mac OS X 10.5 for more information about using JTextFields as search fields.
Hardware MIDI Devices Supported by javax.sound.midi.*
You can now use external MIDI keyboards and other external MIDI devices from the JavaSound API. You can get the list of all MIDI devices from MidiSystem.getMidiDeviceInfo()
. From the device objects you can use Transmitter and Receiver instances to send and receive MIDI events to external devices.
SIGTERM Signal Handling Changed for Parent Processes
Child Java processes will continue execution after their parent is terminated with SIGTERM. In prior releases of Java for OS X, killing a parent process with SIGTERM would also kill any Java child processes. This change was made to be consistent with the behavior of Java on other platforms, and with other processes on OS X.
JavaNativeFoundation.framework API Additions
The JavaNativeFoundation.framework provides JNI helpers and low-level conversion functions between core Java classes and their equivalents in Objective-C's Foundation. Java for OS X now contains helper functions for creating object and primitive arrays, as well as converter functions between java.util.Date/java.util.Calendar and NSDate. [JNFDefaultCoercions defaultCoercer]
now provides a date coercer as well. To obtain the new headers for the JavaNativeFoundation.framework, download the developer documentation for Java for OS X v10.6 Update 1 or Java for OS X v10.5 Update 6 from Apple Developer Connection.
Java Applet Console Changes
The Java debugging console has been refreshed with a new appearance and a new way to show and hide it. Previously, if you attempted to close the console it would minimize instead to prevent itself from becoming inaccessible. Now, when the console is activated, a coffee cup NSStatusItem is added to the menu bar which contains menu items that hide and show the console. The NSStatusItem will be present until the hosting application is quit. Launching multiple web browser instances using the console will result in multiple coffee cup icons in your menu bar. The Java console is not on by default, but can be activated from the "Advanced" tab of Java Preferences. The Java console for Web Start applications does not install the coffee cup NSStatusItem, and will become inaccessible when closed.
Copyright © 2010 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2010-01-20