Starting with release J2SETM 5.0, AWT has been re-implemented on the Solaris and Linux platforms. The new Toolkit implementation provides the following advantages:
- Removes the dependency on Motif and Xt libraries.
- Interoperates better with other GUI Toolkits.
- Provides better performance and quality.
The new Toolkit (XToolkit) is the default on Linux in J2SE 5.0. Solaris will continue to use the MToolkit (Motif-based Toolkit) as the default in J2SE 5.0, but eventually will be replaced with XToolkit.
Explicitly Setting the Toolkit
You can explicitly set the toolkit for an applet or application using an environment variable or a system property. Keep in mind that the environment variable overrides the system property.
- Setting the toolkit for an application:
- Using an environment variable. This needs to be set before starting the VM.
csh: setenv AWT_TOOLKIT XToolkit #selects the XToolkit setenv AWT_TOOLKIT MToolkit #selects the MToolkit ksh/bash: export AWT_TOOLKIT=XToolkit export AWT_TOOLKIT=MToolkit
- Using a system property on the command line:
java -Dawt.toolkit=sun.awt.X11.XToolkit MyApp java -Dawt.toolkit=sun.awt.motif.MToolkit MyApp- Setting the toolkit for an applet:
- Using an environment variable.
If the browser is started from a terminal window, the environment variable must be set in the terminal window before launching the browser. If the browser is launched from a desktop icon or menu, the toolkit for an applet can't be set using an environment variable. The Java Plug-in Control Panel should be used instead.
- Using the Plug-in Control Panel:
- Launch the Java Plug-in Control Panel:
$java_home/bin/ControlPanel
- Add the system property to the Java Runtime Parameters field under the Advanced tab.
-Dawt.toolkit=sun.awt.X11.XToolkit -Dawt.toolkit=sun.awt.motif.MToolkit