The following features were introduced in the Java SE 6.0:
The new modality model was introduced to handle modality blocking of a dialog box. This model comprises four modality types: modeless, application-modal, document-modal, and toolkit-modal.
public Dialog(Window owner, String title, Dialog.ModalityType modalityType,GraphicsConfiguration gc)
modalityTypes parameter specifies whether a
dialog box blocks input to other windows when shown. The null value
and unsupported modality types are equivalent to the modeless type.
methods of the
Dialog class allows you accordingly to
return and set the modality type for the dialog box.
Any top-level window can be marked so it will not be blocked by
modal dialogs. This property enables you to set up the modal
exclusion mode. The
Window class specifies one of the following
modal exclusion modes:
See the How to Use Modality in Dialogs section of the Swing tutorial for more information about modality.
The Desktop API (
API is provided to allow Java applications to interact with default
applications associated with specific file types. All provided
actions are represented as a
Desktop.Action enumeration instance:
isSupported method of the
Desktop class to
check whether an action is supported on the current platform.
How to Integrate with the Desktop Class section of the Swing
tutorial for more information about using the
There is a new solution that allows the application to display
the splash screen before the virtual machine starts has been
introduced. Although the
class cannot be sued to create a splash screen, a Java application
can close the splash screen, change the splash screen image, get
the image position/size and paint in the splash screen. An instance
SplashScreen class can be obtained using the
getSplashScreen() static method.
To run an application with the splash screen from the command line use the following command:
java -splash:<file name> <class name>
See the How to Create a Splash Screen section of the Swing Tutorial for more information about splash screen.
class is intended to represent the system tray for a desktop. The
system tray can be accessed by calling the
getSystemTray() static method. The system tray may
contain one or more tray icons represented by the
class objects. However, the
functionality is not limited to creating a tray icon. It also
includes a text tooltip, a pop-up menu, and balloon messages:
TrayIcon trayIcon = new TrayIcon(createImage("icon.gif", "tray icon")); trayIcon.displayMessage("Sun TrayIcon Demo", "This is an info message", TrayIcon.MessageType.INFO); trayIcon.setToolTip("Sun TrayIcon");
Note: The current implementation of the
TrayIcon class provides limited support of the Swing
components. The workaround proposal for this issue is described in
the Bug Database, see Bug ID 6285881.
See the How to Use the System Tray section of the Swing Tutorial for more information about the system tray and tray icons.
Two new methods of the
enable to obtain the baseline measured from the top of the
component and to handle the baseline change as the size of the
public int getBaseline(int width int height)
public Component.BaselineResizeBehavior getBaselineResizeBehavior()
Two methods were introduced to control vertical components' alignment along their baseline:
The following constraints were added to the
GridBagConstraints class to enhance lay outing
components with the
GridBagLayoutInfo class was introduced to store align,
size, and baseline parameters for every component within a
container while lay outing components using
New methods were added to the
Window class to
handle images that are displayed as the icon for the window. While
setIconImage(Image image) method sets the only one
setIconImages(List<? extends Image>
icons) method supports the sequence of images of different
dimensions to be applied depending on the platform
In Java SE 6 a
can be created without a parent frame, the
parameter in constructors of such objects equals
Mouse dragged events were received after the drag sensitivity setting of the operating system is reached. In the proposed solution the drag distance parameter of the operating system is ignored. Java drag events will be ganerated on the first movement of the mouse.
Some events essential for cursor update were not delivered while maximazing a window. The fix comprises x-crossing event handling within XWindow.
Using Alt+Tab to navigate from a Java window to a native application window and back to the Java window resulted in the focus being moved to the first menu item of the Java window. The proposed fix allows to keep the focus on the initially focused component of the Java window.
JTextArea, etc), even in fields that have been previously edited. Other components as combo boxes, tables, radio buttons remain editable.
The XWindow.java code lacks multi click handling. So, when the
user dragged the mouse on the screen onto the Linux box, double
clicks occurred when the user expected single clicks. Likewise,
single clicks occurred when the user expected no clicks at all. The
fix includes the
AWT_MULTICLICK_SMUDGE variable to
apply a smudge factor so that moving the mouse by a small amount
does not wipe out the multi-click state variables.
The applet itself did not get the focus, which apparently went to the embedded frame.This incompatibility was caused by a focus rearchitecture introduced in Java SE 1.4. The fix restores initial proper behavior.
Frameobject is not being enforced
Window.setMinimumSize() method has been
modified to restrict user-resizing of top-level windows below
specified dimensions. Previously, minimum size set for toplevel
windows was ignored by platform, so this change can impact code
that uses the
minimumSize property of top-level
windows for its own needs.
6199167: Live resizing
Native applications on Windows had the property to dynamically relayout and repaint during resizing. This property was controlled through system desktop settings. Java disables this property by default. In Java SE 6 the required property is enables by default.
If a locale was defined incorrectly, a native Input Method did
not process keysyms and passed them as is to AWT
handleKeyEvent routine. In the fix a conversion table
is added and key event handling generally streamlined in non Input
Here is a list of known problems you may encounter in release 6.0.
JWindowcomponent stays on top of all other windows
JWindow component stays up on top of all other
windows hiding other windows behind it on Solaris and Linux. To
workaround, you can use an undecorated frame.
In some synthetic situations (such as repeated showing/disposing of a toplevel) the JVM may crash.