Starting with JavaTM SE 5.0, AWT has been re-implemented on the Solaris and Linux platforms. The newToolkit
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 default both on Linux and Solaris.
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 cannot 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