APIdia Launch Partner
Top Fields Constructors Methods
sun.awt

public final Class HeadlessToolkit

extends Toolkit
implements ComponentFactory, KeyboardFocusManagerPeerProvider
Class Inheritance
All Implemented Interfaces
sun.awt.KeyboardFocusManagerPeerProvider, sun.awt.ComponentFactory
Imports
java.awt.*, java.awt.datatransfer.Clipboard, java.awt.dnd.DragGestureListener, .DragGestureRecognizer, .DragSource, java.awt.event.AWTEventListener, .InputEvent, java.awt.font.TextAttribute, java.awt.im.InputMethodHighlight, java.awt.image.ColorModel, .ImageObserver, .ImageProducer, java.awt.peer.FontPeer, .KeyboardFocusManagerPeer, .SystemTrayPeer, .TrayIconPeer, java.beans.PropertyChangeListener, java.net.URL, java.util.Map, .Properties

Field Summary

Modifier and TypeField and Description
private ComponentFactory
private static final KeyboardFocusManagerPeer
private final Toolkit
Inherited from java.awt.Toolkit:
desktopPropertiesdesktopPropsSupport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addAWTEventListener(AWTEventListener listener, long eventMask)

Overrides java.awt.Toolkit.addAWTEventListener.

Adds an AWTEventListener to receive all AWTEvents dispatched system-wide that conform to the given eventMask.

public void
addPropertyChangeListener(String name, PropertyChangeListener pcl)

Overrides java.awt.Toolkit.addPropertyChangeListener.

Adds the specified property change listener for the named desktop property.

public boolean
areExtraMouseButtonsEnabled()

Overrides java.awt.Toolkit.areExtraMouseButtonsEnabled.

Reports whether events from extra mouse buttons are allowed to be processed and posted into EventQueue.

public void
beep()

Implements abstract java.awt.Toolkit.beep.

Emits an audio beep depending on native system settings and hardware capabilities.

public int
checkImage(Image img, int w, int h, ImageObserver o)

Implements abstract java.awt.Toolkit.checkImage.

Indicates the construction status of a specified image that is being prepared for display.

public Cursor
createCustomCursor(Image cursor, Point hotSpot, String name)

Overrides java.awt.Toolkit.createCustomCursor.

Creates a new custom cursor object.

public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)

Overrides java.awt.Toolkit.createDragGestureRecognizer.

Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified.

public Image
createImage(String filename)

Implements abstract java.awt.Toolkit.createImage.

Returns an image which gets pixel data from the specified file.

public Image
createImage(URL url)

Implements abstract java.awt.Toolkit.createImage.

Returns an image which gets pixel data from the specified URL.

public Image
createImage(byte[] data, int offset, int length)

Implements abstract java.awt.Toolkit.createImage.

Creates an image which decodes the image stored in the specified byte array, and at the specified offset and length.

public Image
createImage(ImageProducer producer)

Implements abstract java.awt.Toolkit.createImage.

Creates an image with the specified image producer.

public Image
createImage(byte[] imagedata)

Overrides java.awt.Toolkit.createImage.

Creates an image which decodes the image stored in the specified byte array.

public SystemTrayPeer
public TrayIconPeer
public AWTEventListener[]
getAWTEventListeners()

Overrides java.awt.Toolkit.getAWTEventListeners.

Returns an array of all the AWTEventListeners registered on this toolkit.

public AWTEventListener[]
getAWTEventListeners(long eventMask)

Overrides java.awt.Toolkit.getAWTEventListeners.

Returns an array of all the AWTEventListeners registered on this toolkit which listen to all of the event types specified in the eventMask argument.

public Dimension
getBestCursorSize(int preferredWidth, int preferredHeight)

Overrides java.awt.Toolkit.getBestCursorSize.

Returns the supported cursor dimension which is closest to the desired sizes.

public ColorModel
getColorModel()

Implements abstract java.awt.Toolkit.getColorModel.

Determines the color model of this toolkit's screen.

public String[]
getFontList()

Implements abstract java.awt.Toolkit.getFontList.

Returns the names of the available fonts in this toolkit.

public FontMetrics
getFontMetrics(Font font)

Implements abstract java.awt.Toolkit.getFontMetrics.

Gets the screen device metrics for rendering of the font.

public FontPeer
getFontPeer(String name, int style)

Overrides default sun.awt.ComponentFactory.getFontPeer.

Creates this toolkit's implementation of Font using the specified peer interface.

public GlobalCursorManager
public Image
getImage(String filename)

Implements abstract java.awt.Toolkit.getImage.

Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG.

public Image
getImage(URL url)

Implements abstract java.awt.Toolkit.getImage.

Returns an image which gets pixel data from the specified URL.

public KeyboardFocusManagerPeer
getKeyboardFocusManagerPeer()

Implements sun.awt.KeyboardFocusManagerPeerProvider.getKeyboardFocusManagerPeer.

Gets a singleton KeyboardFocusManagerPeer instance.

public boolean
getLockingKeyState(int keyCode)

Overrides java.awt.Toolkit.getLockingKeyState.

Returns whether the given locking key on the keyboard is currently in its "on" state.

public int
getMaximumCursorColors()

Overrides java.awt.Toolkit.getMaximumCursorColors.

Returns the maximum number of colors the Toolkit supports in a custom cursor palette.

public int
getMenuShortcutKeyMask()

Overrides java.awt.Toolkit.getMenuShortcutKeyMask.

Deprecated since 10.

Determines which modifier key is the appropriate accelerator key for menu shortcuts.

public int
getMenuShortcutKeyMaskEx()

Overrides java.awt.Toolkit.getMenuShortcutKeyMaskEx.

Determines which extended modifier key is the appropriate accelerator key for menu shortcuts.

public PrintJob
getPrintJob(Frame frame, String jobtitle, JobAttributes jobAttributes, PageAttributes pageAttributes)

Overrides java.awt.Toolkit.getPrintJob.

Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

public PrintJob
getPrintJob(Frame frame, String doctitle, Properties props)

Implements abstract java.awt.Toolkit.getPrintJob.

Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

public Insets
getScreenInsets(GraphicsConfiguration gc)

Overrides java.awt.Toolkit.getScreenInsets.

Gets the insets of the screen.

public int
getScreenResolution()

Implements abstract java.awt.Toolkit.getScreenResolution.

Returns the screen resolution in dots-per-inch.

public Dimension
getScreenSize()

Implements abstract java.awt.Toolkit.getScreenSize.

Gets the size of the screen.

public Clipboard
getSystemClipboard()

Implements abstract java.awt.Toolkit.getSystemClipboard.

Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform.

public EventQueue
getSystemEventQueueImpl()

Implements abstract java.awt.Toolkit.getSystemEventQueueImpl.

A method used by toolkit subclasses to get the EventQueue.

public Toolkit
public boolean
isAlwaysOnTopSupported()

Overrides java.awt.Toolkit.isAlwaysOnTopSupported.

Returns whether the always-on-top mode is supported by this toolkit.

public boolean
public boolean
isDynamicLayoutActive()

Overrides java.awt.Toolkit.isDynamicLayoutActive.

Returns whether dynamic layout of Containers on resize is currently enabled on the underlying operating system and/or window manager.

protected boolean
isDynamicLayoutSet()

Overrides java.awt.Toolkit.isDynamicLayoutSet.

Returns whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.

public boolean
isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType)

Implements abstract java.awt.Toolkit.isModalExclusionTypeSupported.

Returns whether the given modal exclusion type is supported by this toolkit.

public boolean
isModalityTypeSupported(Dialog.ModalityType modalityType)

Implements abstract java.awt.Toolkit.isModalityTypeSupported.

Returns whether the given modality type is supported by this toolkit.

public boolean
protected void
loadSystemColors(int[] systemColors)

Overrides java.awt.Toolkit.loadSystemColors.

Fills in the integer array that is supplied as an argument with the current system color values.

public Map<TextAttribute, ?>
mapInputMethodHighlight(InputMethodHighlight highlight)

Implements abstract java.awt.Toolkit.mapInputMethodHighlight.

Returns a map of visual attributes for the abstract level description of the given input method highlight, or null if no mapping is found.

public boolean
prepareImage(Image img, int w, int h, ImageObserver o)

Implements abstract java.awt.Toolkit.prepareImage.

Prepares an image for rendering.

public void
removeAWTEventListener(AWTEventListener listener)

Overrides java.awt.Toolkit.removeAWTEventListener.

Removes an AWTEventListener from receiving dispatched AWTEvents.

public void
removePropertyChangeListener(String name, PropertyChangeListener pcl)

Overrides java.awt.Toolkit.removePropertyChangeListener.

Removes the specified property change listener for the named desktop property.

public void
setDynamicLayout(boolean dynamic)

Overrides java.awt.Toolkit.setDynamicLayout.

Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.

public void
setLockingKeyState(int keyCode, boolean on)

Overrides java.awt.Toolkit.setLockingKeyState.

Sets the state of the given locking key on the keyboard.

public void
sync()

Implements abstract java.awt.Toolkit.sync.

Synchronizes this toolkit's graphics state.

Inherited from java.awt.Toolkit:
getDefaultToolkitgetDesktopPropertygetNativeContainergetPropertygetPropertyChangeListenersgetPropertyChangeListenersgetSystemEventQueuegetSystemSelectioninitializeDesktopPropertiesisFrameStateSupportedlazilyLoadDesktopPropertysetDesktopProperty

Field Detail

componentFactoryback to summary
private ComponentFactory componentFactory
kfmPeerback to summary
private static final KeyboardFocusManagerPeer kfmPeer
tkback to summary
private final Toolkit tk

Constructor Detail

HeadlessToolkitback to summary
public HeadlessToolkit(Toolkit tk)

Method Detail

addAWTEventListenerback to summary
public void addAWTEventListener(AWTEventListener listener, long eventMask)

Overrides java.awt.Toolkit.addAWTEventListener.

Doc from java.awt.Toolkit.addAWTEventListener.

Adds an AWTEventListener to receive all AWTEvents dispatched system-wide that conform to the given eventMask.

eventMask is a bitmask of event types to receive. It is constructed by bitwise OR-ing together the event masks defined in AWTEvent.

Note

event listener use is not recommended for normal application use, but are intended solely to support special purpose facilities including support for accessibility, event record/playback, and diagnostic tracing. If listener is null, no exception is thrown and no action is performed.

Annotations
@Override
addPropertyChangeListenerback to summary
public void addPropertyChangeListener(String name, PropertyChangeListener pcl)

Overrides java.awt.Toolkit.addPropertyChangeListener.

Doc from java.awt.Toolkit.addPropertyChangeListener.

Adds the specified property change listener for the named desktop property. When a java.beans.PropertyChangeListenerProxy object is added, its property name is ignored, and the wrapped listener is added. If name is null or pcl is null, no exception is thrown and no action is performed.

Annotations
@Override
areExtraMouseButtonsEnabledback to summary
public boolean areExtraMouseButtonsEnabled() throws HeadlessException

Overrides java.awt.Toolkit.areExtraMouseButtonsEnabled.

Doc from java.awt.Toolkit.areExtraMouseButtonsEnabled.

Reports whether events from extra mouse buttons are allowed to be processed and posted into EventQueue.
To change the returned value it is necessary to set the sun.awt.enableExtraMouseButtons property before the Toolkit class initialization. This setting could be done on the application startup by the following command:

java -Dsun.awt.enableExtraMouseButtons=false Application
Alternatively, the property could be set in the application by using the following code:
System.setProperty("sun.awt.enableExtraMouseButtons", "true");
before the Toolkit class initialization. If not set by the time of the Toolkit class initialization, this property will be initialized with true. Changing this value after the Toolkit class initialization will have no effect.
Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
beepback to summary
public void beep()

Implements abstract java.awt.Toolkit.beep.

Doc from java.awt.Toolkit.beep.

Emits an audio beep depending on native system settings and hardware capabilities.

Annotations
@Override
checkImageback to summary
public int checkImage(Image img, int w, int h, ImageObserver o)

Implements abstract java.awt.Toolkit.checkImage.

Doc from java.awt.Toolkit.checkImage.

Indicates the construction status of a specified image that is being prepared for display.

If the values of the width and height arguments are both -1, this method returns the construction status of a screen representation of the specified image in this toolkit. Otherwise, this method returns the construction status of a scaled representation of the image at the specified width and height.

This method does not cause the image to begin loading. An application must call prepareImage to force the loading of an image.

This method is called by the component's checkImage methods.

Information on the flags returned by this method can be found with the definition of the ImageObserver interface.

Annotations
@Override
createCustomCursorback to summary
public Cursor createCustomCursor(Image cursor, Point hotSpot, String name) throws IndexOutOfBoundsException, HeadlessException

Overrides java.awt.Toolkit.createCustomCursor.

Doc from java.awt.Toolkit.createCustomCursor.

Creates a new custom cursor object. If the image to display is invalid, the cursor will be hidden (made completely transparent), and the hotspot will be set to (0, 0).

Note that multi-frame images are invalid and may cause this method to hang.

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if the hotSpot values are outside the bounds of the cursor
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
createDragGestureRecognizerback to summary
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)

Overrides java.awt.Toolkit.createDragGestureRecognizer.

Doc from java.awt.Toolkit.createDragGestureRecognizer.

Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified. subclasses should override this to provide their own implementation

Annotations
@Override
createImageback to summary
public Image createImage(String filename)

Implements abstract java.awt.Toolkit.createImage.

Doc from java.awt.Toolkit.createImage.

Returns an image which gets pixel data from the specified file. The returned Image is a new object which will not be shared with any other caller of this method or its getImage variant.

Annotations
@Override
createImageback to summary
public Image createImage(URL url)

Implements abstract java.awt.Toolkit.createImage.

Doc from java.awt.Toolkit.createImage.

Returns an image which gets pixel data from the specified URL. The returned Image is a new object which will not be shared with any other caller of this method or its getImage variant.

Annotations
@Override
createImageback to summary
public Image createImage(byte[] data, int offset, int length)

Implements abstract java.awt.Toolkit.createImage.

Doc from java.awt.Toolkit.createImage.

Creates an image which decodes the image stored in the specified byte array, and at the specified offset and length. The data must be in some image format, such as GIF or JPEG, that is supported by this toolkit.

Annotations
@Override
createImageback to summary
public Image createImage(ImageProducer producer)

Implements abstract java.awt.Toolkit.createImage.

Doc from java.awt.Toolkit.createImage.

Creates an image with the specified image producer.

Annotations
@Override
createImageback to summary
public Image createImage(byte[] imagedata)

Overrides java.awt.Toolkit.createImage.

Doc from java.awt.Toolkit.createImage.

Creates an image which decodes the image stored in the specified byte array.

The data must be in some image format, such as GIF or JPEG, that is supported by this toolkit.

Annotations
@Override
createSystemTrayback to summary
public SystemTrayPeer createSystemTray(SystemTray target) throws HeadlessException
createTrayIconback to summary
public TrayIconPeer createTrayIcon(TrayIcon target) throws HeadlessException
getAWTEventListenersback to summary
public AWTEventListener[] getAWTEventListeners()

Overrides java.awt.Toolkit.getAWTEventListeners.

Doc from java.awt.Toolkit.getAWTEventListeners.

Returns an array of all the AWTEventListeners registered on this toolkit. Listeners can be returned within AWTEventListenerProxy objects, which also contain the event mask for the given listener. Note that listener objects added multiple times appear only once in the returned array.

Annotations
@Override
getAWTEventListenersback to summary
public AWTEventListener[] getAWTEventListeners(long eventMask)

Overrides java.awt.Toolkit.getAWTEventListeners.

Doc from java.awt.Toolkit.getAWTEventListeners.

Returns an array of all the AWTEventListeners registered on this toolkit which listen to all of the event types specified in the eventMask argument. Listeners can be returned within AWTEventListenerProxy objects, which also contain the event mask for the given listener. Note that listener objects added multiple times appear only once in the returned array.

Annotations
@Override
getBestCursorSizeback to summary
public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) throws HeadlessException

Overrides java.awt.Toolkit.getBestCursorSize.

Doc from java.awt.Toolkit.getBestCursorSize.

Returns the supported cursor dimension which is closest to the desired sizes. Systems which only support a single cursor size will return that size regardless of the desired sizes. Systems which don't support custom cursors will return a dimension of 0, 0.

Note

if an image is used whose dimensions don't match a supported size (as returned by this method), the Toolkit implementation will attempt to resize the image to a supported size. Since converting low-resolution images is difficult, no guarantees are made as to the quality of a cursor image which isn't a supported size. It is therefore recommended that this method be called and an appropriate image used so no image conversion is made.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getColorModelback to summary
public ColorModel getColorModel() throws HeadlessException

Implements abstract java.awt.Toolkit.getColorModel.

Doc from java.awt.Toolkit.getColorModel.

Determines the color model of this toolkit's screen.

ColorModel is an abstract class that encapsulates the ability to translate between the pixel values of an image and its red, green, blue, and alpha components.

This toolkit method is called by the getColorModel method of the Component class.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getFontListback to summary
public String[] getFontList()

Implements abstract java.awt.Toolkit.getFontList.

Doc from java.awt.Toolkit.getFontList.

Returns the names of the available fonts in this toolkit.

For 1.1, the following font names are deprecated (the replacement name follows):

  • TimesRoman (use Serif)
  • Helvetica (use SansSerif)
  • Courier (use Monospaced)

The ZapfDingbats fontname is also deprecated in 1.1 but the characters are defined in Unicode starting at 0x2700, and as of 1.1 Java supports those characters.

Annotations
@Override
@SuppressWarnings:deprecation
getFontMetricsback to summary
public FontMetrics getFontMetrics(Font font)

Implements abstract java.awt.Toolkit.getFontMetrics.

Doc from java.awt.Toolkit.getFontMetrics.

Gets the screen device metrics for rendering of the font.

Annotations
@Override
@SuppressWarnings:deprecation
getFontPeerback to summary
public FontPeer getFontPeer(String name, int style)

Overrides default sun.awt.ComponentFactory.getFontPeer.

Doc from sun.awt.ComponentFactory.getFontPeer.

Creates this toolkit's implementation of Font using the specified peer interface.

Annotations
@Override
getGlobalCursorManagerback to summary
public GlobalCursorManager getGlobalCursorManager() throws HeadlessException
getImageback to summary
public Image getImage(String filename)

Implements abstract java.awt.Toolkit.getImage.

Doc from java.awt.Toolkit.getImage.

Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG. The underlying toolkit attempts to resolve multiple requests with the same filename to the same returned Image.

Since the mechanism required to facilitate this sharing of Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the createImage variant wherever available. If the image data contained in the specified file changes, the Image object returned from this method may still contain stale information which was loaded from the file after a prior call. Previously loaded image data can be manually discarded by calling the flush method on the returned Image.

Annotations
@Override
getImageback to summary
public Image getImage(URL url)

Implements abstract java.awt.Toolkit.getImage.

Doc from java.awt.Toolkit.getImage.

Returns an image which gets pixel data from the specified URL. The pixel data referenced by the specified URL must be in one of the following formats: GIF, JPEG or PNG. The underlying toolkit attempts to resolve multiple requests with the same URL to the same returned Image.

Since the mechanism required to facilitate this sharing of Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the createImage variant wherever available. If the image data stored at the specified URL changes, the Image object returned from this method may still contain stale information which was fetched from the URL after a prior call. Previously loaded image data can be manually discarded by calling the flush method on the returned Image.

Annotations
@Override
getKeyboardFocusManagerPeerback to summary
public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer()

Implements sun.awt.KeyboardFocusManagerPeerProvider.getKeyboardFocusManagerPeer.

Doc from sun.awt.KeyboardFocusManagerPeerProvider.getKeyboardFocusManagerPeer.

Gets a singleton KeyboardFocusManagerPeer instance.

Annotations
@Override
getLockingKeyStateback to summary
public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException

Overrides java.awt.Toolkit.getLockingKeyState.

Doc from java.awt.Toolkit.getLockingKeyState.

Returns whether the given locking key on the keyboard is currently in its "on" state. Valid key codes are VK_CAPS_LOCK, VK_NUM_LOCK, VK_SCROLL_LOCK, and VK_KANA_LOCK.

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the host system doesn't allow getting the state of this key programmatically, or if the keyboard doesn't have this key
getMaximumCursorColorsback to summary
public int getMaximumCursorColors() throws HeadlessException

Overrides java.awt.Toolkit.getMaximumCursorColors.

Doc from java.awt.Toolkit.getMaximumCursorColors.

Returns the maximum number of colors the Toolkit supports in a custom cursor palette.

Note

if an image is used which has more colors in its palette than the supported maximum, the Toolkit implementation will attempt to flatten the palette to the maximum. Since converting low-resolution images is difficult, no guarantees are made as to the quality of a cursor image which has more colors than the system supports. It is therefore recommended that this method be called and an appropriate image used so no image conversion is made.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getMenuShortcutKeyMaskback to summary
public int getMenuShortcutKeyMask() throws HeadlessException

Overrides java.awt.Toolkit.getMenuShortcutKeyMask.

Doc from java.awt.Toolkit.getMenuShortcutKeyMask.

Deprecated

since 10.

Determines which modifier key is the appropriate accelerator key for menu shortcuts.

Menu shortcuts, which are embodied in the MenuShortcut class, are handled by the MenuBar class.

By default, this method returns Event.CTRL_MASK. Toolkit implementations should override this method if the Control key isn't the correct key for accelerators.

Annotations
@Override
@Deprecated
since:10
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getMenuShortcutKeyMaskExback to summary
public int getMenuShortcutKeyMaskEx() throws HeadlessException

Overrides java.awt.Toolkit.getMenuShortcutKeyMaskEx.

Doc from java.awt.Toolkit.getMenuShortcutKeyMaskEx.

Determines which extended modifier key is the appropriate accelerator key for menu shortcuts.

Menu shortcuts, which are embodied in the MenuShortcut class, are handled by the MenuBar class.

By default, this method returns InputEvent.CTRL_DOWN_MASK. Toolkit implementations should override this method if the Control key isn't the correct key for accelerators.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getPrintJobback to summary
public PrintJob getPrintJob(Frame frame, String jobtitle, JobAttributes jobAttributes, PageAttributes pageAttributes)

Overrides java.awt.Toolkit.getPrintJob.

Doc from java.awt.Toolkit.getPrintJob.

Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

Annotations
@Override
getPrintJobback to summary
public PrintJob getPrintJob(Frame frame, String doctitle, Properties props)

Implements abstract java.awt.Toolkit.getPrintJob.

Doc from java.awt.Toolkit.getPrintJob.

Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.

Annotations
@Override
getScreenInsetsback to summary
public Insets getScreenInsets(GraphicsConfiguration gc) throws HeadlessException

Overrides java.awt.Toolkit.getScreenInsets.

Doc from java.awt.Toolkit.getScreenInsets.

Gets the insets of the screen.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getScreenResolutionback to summary
public int getScreenResolution() throws HeadlessException

Implements abstract java.awt.Toolkit.getScreenResolution.

Doc from java.awt.Toolkit.getScreenResolution.

Returns the screen resolution in dots-per-inch.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getScreenSizeback to summary
public Dimension getScreenSize() throws HeadlessException

Implements abstract java.awt.Toolkit.getScreenSize.

Doc from java.awt.Toolkit.getScreenSize.

Gets the size of the screen. On systems with multiple displays, the primary display is used. Multi-screen aware display dimensions are available from GraphicsConfiguration and GraphicsDevice.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getSystemClipboardback to summary
public Clipboard getSystemClipboard() throws HeadlessException

Implements abstract java.awt.Toolkit.getSystemClipboard.

Doc from java.awt.Toolkit.getSystemClipboard.

Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform. This clipboard enables data transfer between Java programs and native applications which use native clipboard facilities.

In addition to any and all default formats text returned by the system Clipboard's getTransferData() method is available in the following flavors:

  • DataFlavor.stringFlavor
  • DataFlavor.plainTextFlavor (deprecated)
As with java.awt.datatransfer.StringSelection, if the requested flavor is DataFlavor.plainTextFlavor, or an equivalent flavor, a Reader is returned

Note

The behavior of the system Clipboard's getTransferData() method for DataFlavor.plainTextFlavor, and equivalent DataFlavors, is inconsistent with the definition of DataFlavor.plainTextFlavor. Because of this, support for DataFlavor.plainTextFlavor, and equivalent flavors, is deprecated.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
getSystemEventQueueImplback to summary
public EventQueue getSystemEventQueueImpl()

Implements abstract java.awt.Toolkit.getSystemEventQueueImpl.

Doc from java.awt.Toolkit.getSystemEventQueueImpl.

A method used by toolkit subclasses to get the EventQueue. This may be more direct or more efficient than calling getSystemEventQueue().

Annotations
@Override
getUnderlyingToolkitback to summary
public Toolkit getUnderlyingToolkit()
isAlwaysOnTopSupportedback to summary
public boolean isAlwaysOnTopSupported()

Overrides java.awt.Toolkit.isAlwaysOnTopSupported.

Doc from java.awt.Toolkit.isAlwaysOnTopSupported.

Returns whether the always-on-top mode is supported by this toolkit. To detect whether the always-on-top mode is supported for a particular Window, use Window#isAlwaysOnTopSupported.

Annotations
@Override
isDesktopSupportedback to summary
public boolean isDesktopSupported()
isDynamicLayoutActiveback to summary
public boolean isDynamicLayoutActive() throws HeadlessException

Overrides java.awt.Toolkit.isDynamicLayoutActive.

Doc from java.awt.Toolkit.isDynamicLayoutActive.

Returns whether dynamic layout of Containers on resize is currently enabled on the underlying operating system and/or window manager. If the platform supports it, setDynamicLayout(boolean) may be used to programmatically enable or disable platform dynamic layout. Regardless of whether that toggling is supported, or whether true or false is specified as an argument, or has never been called at all, this method will return the active current platform behavior and which will be followed by the JDK in determining layout policy during resizing.

If dynamic layout is currently inactive then Containers re-layout their components when resizing is completed. As a result the Component.validate() method will be invoked only once per resize. If dynamic layout is currently active then Containers re-layout their components on every native resize event and the validate() method will be invoked each time. The OS/WM support can be queried using the getDesktopProperty("awt.dynamicLayoutSupported") method. This property will reflect the platform capability but is not sufficient to tell if it is presently enabled.

Annotations
@Override
Exceptions
HeadlessException:
if the GraphicsEnvironment.isHeadless() method returns true
isDynamicLayoutSetback to summary
protected boolean isDynamicLayoutSet() throws HeadlessException

Overrides java.awt.Toolkit.isDynamicLayoutSet.

Doc from java.awt.Toolkit.isDynamicLayoutSet.

Returns whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.

Note

this method returns the value that was set programmatically; it does not reflect support at the level of the operating system or window manager for dynamic layout on resizing, or the current operating system or window manager settings. The OS/WM support can be queried using getDesktopProperty("awt.dynamicLayoutSupported").

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
isModalExclusionTypeSupportedback to summary
public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType)

Implements abstract java.awt.Toolkit.isModalExclusionTypeSupported.

Doc from java.awt.Toolkit.isModalExclusionTypeSupported.

Returns whether the given modal exclusion type is supported by this toolkit. If an unsupported modal exclusion type property is set on a window, then Dialog.ModalExclusionType.NO_EXCLUDE is used instead.

Annotations
@Override
isModalityTypeSupportedback to summary
public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)

Implements abstract java.awt.Toolkit.isModalityTypeSupported.

Doc from java.awt.Toolkit.isModalityTypeSupported.

Returns whether the given modality type is supported by this toolkit. If a dialog with unsupported modality type is created, then Dialog.ModalityType.MODELESS is used instead.

Annotations
@Override
isTraySupportedback to summary
public boolean isTraySupported()
loadSystemColorsback to summary
protected void loadSystemColors(int[] systemColors) throws HeadlessException

Overrides java.awt.Toolkit.loadSystemColors.

Doc from java.awt.Toolkit.loadSystemColors.

Fills in the integer array that is supplied as an argument with the current system color values.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
mapInputMethodHighlightback to summary
public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) throws HeadlessException

Implements abstract java.awt.Toolkit.mapInputMethodHighlight.

Doc from java.awt.Toolkit.mapInputMethodHighlight.

Returns a map of visual attributes for the abstract level description of the given input method highlight, or null if no mapping is found. The style field of the input method highlight is ignored. The map returned is unmodifiable.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless returns true
prepareImageback to summary
public boolean prepareImage(Image img, int w, int h, ImageObserver o)

Implements abstract java.awt.Toolkit.prepareImage.

Doc from java.awt.Toolkit.prepareImage.

Prepares an image for rendering.

If the values of the width and height arguments are both -1, this method prepares the image for rendering on the default screen; otherwise, this method prepares an image for rendering on the default screen at the specified width and height.

The image data is downloaded asynchronously in another thread, and an appropriately scaled screen representation of the image is generated.

This method is called by components prepareImage methods.

Information on the flags returned by this method can be found with the definition of the ImageObserver interface.

Annotations
@Override
removeAWTEventListenerback to summary
public void removeAWTEventListener(AWTEventListener listener)

Overrides java.awt.Toolkit.removeAWTEventListener.

Doc from java.awt.Toolkit.removeAWTEventListener.

Removes an AWTEventListener from receiving dispatched AWTEvents.

Note

event listener use is not recommended for normal application use, but are intended solely to support special purpose facilities including support for accessibility, event record/playback, and diagnostic tracing. If listener is null, no exception is thrown and no action is performed.

Annotations
@Override
removePropertyChangeListenerback to summary
public void removePropertyChangeListener(String name, PropertyChangeListener pcl)

Overrides java.awt.Toolkit.removePropertyChangeListener.

Doc from java.awt.Toolkit.removePropertyChangeListener.

Removes the specified property change listener for the named desktop property. When a java.beans.PropertyChangeListenerProxy object is removed, its property name is ignored, and the wrapped listener is removed. If name is null or pcl is null, no exception is thrown and no action is performed.

Annotations
@Override
setDynamicLayoutback to summary
public void setDynamicLayout(boolean dynamic) throws HeadlessException

Overrides java.awt.Toolkit.setDynamicLayout.

Doc from java.awt.Toolkit.setDynamicLayout.

Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete. Use isDynamicLayoutActive() to detect if this feature enabled in this program and is supported by this operating system and/or window manager. Note that this feature is supported not on all platforms, and conversely, that this feature cannot be turned off on some platforms. On these platforms where dynamic layout during resizing is not supported (or is always supported), setting this property has no effect. Note that this feature can be set or unset as a property of the operating system or window manager on some platforms. On such platforms, the dynamic resize property must be set at the operating system or window manager level before this method can take effect. This method does not change support or settings of the underlying operating system or window manager. The OS/WM support can be queried using getDesktopProperty("awt.dynamicLayoutSupported") method.

Annotations
@Override
Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true
setLockingKeyStateback to summary
public void setLockingKeyState(int keyCode, boolean on) throws UnsupportedOperationException

Overrides java.awt.Toolkit.setLockingKeyState.

Doc from java.awt.Toolkit.setLockingKeyState.

Sets the state of the given locking key on the keyboard. Valid key codes are VK_CAPS_LOCK, VK_NUM_LOCK, VK_SCROLL_LOCK, and VK_KANA_LOCK.

Depending on the platform, setting the state of a locking key may involve event processing and therefore may not be immediately observable through getLockingKeyState.

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the host system doesn't allow setting the state of this key programmatically, or if the keyboard doesn't have this key
syncback to summary
public void sync()

Implements abstract java.awt.Toolkit.sync.

Doc from java.awt.Toolkit.sync.

Synchronizes this toolkit's graphics state. Some window systems may do buffering of graphics events.

This method ensures that the display is up-to-date. It is useful for animation.

Annotations
@Override