Toolkit (Java Platform SE 8 ) (original) (raw)

Modifier and Type

Method

Description

void

[addAWTEventListener](../../java/awt/Toolkit.html#addAWTEventListener-java.awt.event.AWTEventListener-long-)([AWTEventListener](../../java/awt/event/AWTEventListener.html "interface in java.awt.event") listener, long eventMask)

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

void

[addPropertyChangeListener](../../java/awt/Toolkit.html#addPropertyChangeListener-java.lang.String-java.beans.PropertyChangeListener-)([String](../../java/lang/String.html "class in java.lang") name,[PropertyChangeListener](../../java/beans/PropertyChangeListener.html "interface in java.beans") pcl)

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

boolean

[areExtraMouseButtonsEnabled](../../java/awt/Toolkit.html#areExtraMouseButtonsEnabled--)()

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

abstract void

[beep](../../java/awt/Toolkit.html#beep--)()

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

abstract int

[checkImage](../../java/awt/Toolkit.html#checkImage-java.awt.Image-int-int-java.awt.image.ImageObserver-)([Image](../../java/awt/Image.html "class in java.awt") image, int width, int height,[ImageObserver](../../java/awt/image/ImageObserver.html "interface in java.awt.image") observer)

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

protected abstract java.awt.peer.ButtonPeer

[createButton](../../java/awt/Toolkit.html#createButton-java.awt.Button-)([Button](../../java/awt/Button.html "class in java.awt") target)

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

protected abstract java.awt.peer.CanvasPeer

[createCanvas](../../java/awt/Toolkit.html#createCanvas-java.awt.Canvas-)([Canvas](../../java/awt/Canvas.html "class in java.awt") target)

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

protected abstract java.awt.peer.CheckboxPeer

[createCheckbox](../../java/awt/Toolkit.html#createCheckbox-java.awt.Checkbox-)([Checkbox](../../java/awt/Checkbox.html "class in java.awt") target)

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

protected abstract java.awt.peer.CheckboxMenuItemPeer

[createCheckboxMenuItem](../../java/awt/Toolkit.html#createCheckboxMenuItem-java.awt.CheckboxMenuItem-)([CheckboxMenuItem](../../java/awt/CheckboxMenuItem.html "class in java.awt") target)

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

protected abstract java.awt.peer.ChoicePeer

[createChoice](../../java/awt/Toolkit.html#createChoice-java.awt.Choice-)([Choice](../../java/awt/Choice.html "class in java.awt") target)

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

protected java.awt.peer.LightweightPeer

[createComponent](../../java/awt/Toolkit.html#createComponent-java.awt.Component-)([Component](../../java/awt/Component.html "class in java.awt") target)

Creates a peer for a component or container.

[Cursor](../../java/awt/Cursor.html "class in java.awt")

[createCustomCursor](../../java/awt/Toolkit.html#createCustomCursor-java.awt.Image-java.awt.Point-java.lang.String-)([Image](../../java/awt/Image.html "class in java.awt") cursor,[Point](../../java/awt/Point.html "class in java.awt") hotSpot,[String](../../java/lang/String.html "class in java.lang") name)

Creates a new custom cursor object.

protected abstract java.awt.peer.DesktopPeer

[createDesktopPeer](../../java/awt/Toolkit.html#createDesktopPeer-java.awt.Desktop-)([Desktop](../../java/awt/Desktop.html "class in java.awt") target)

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

protected abstract java.awt.peer.DialogPeer

[createDialog](../../java/awt/Toolkit.html#createDialog-java.awt.Dialog-)([Dialog](../../java/awt/Dialog.html "class in java.awt") target)

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

<T extends [DragGestureRecognizer](../../java/awt/dnd/DragGestureRecognizer.html "class in java.awt.dnd")> T

[createDragGestureRecognizer](../../java/awt/Toolkit.html#createDragGestureRecognizer-java.lang.Class-java.awt.dnd.DragSource-java.awt.Component-int-java.awt.dnd.DragGestureListener-)([Class](../../java/lang/Class.html "class in java.lang")<T> abstractRecognizerClass,[DragSource](../../java/awt/dnd/DragSource.html "class in java.awt.dnd") ds,[Component](../../java/awt/Component.html "class in java.awt") c, int srcActions,[DragGestureListener](../../java/awt/dnd/DragGestureListener.html "interface in java.awt.dnd") dgl)

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

abstract java.awt.dnd.peer.DragSourceContextPeer

[createDragSourceContextPeer](../../java/awt/Toolkit.html#createDragSourceContextPeer-java.awt.dnd.DragGestureEvent-)([DragGestureEvent](../../java/awt/dnd/DragGestureEvent.html "class in java.awt.dnd") dge)

Creates the peer for a DragSourceContext.

protected abstract java.awt.peer.FileDialogPeer

[createFileDialog](../../java/awt/Toolkit.html#createFileDialog-java.awt.FileDialog-)([FileDialog](../../java/awt/FileDialog.html "class in java.awt") target)

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

protected abstract java.awt.peer.FramePeer

[createFrame](../../java/awt/Toolkit.html#createFrame-java.awt.Frame-)([Frame](../../java/awt/Frame.html "class in java.awt") target)

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

[Image](../../java/awt/Image.html "class in java.awt")

[createImage](../../java/awt/Toolkit.html#createImage-byte:A-)(byte[] imagedata)

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

abstract [Image](../../java/awt/Image.html "class in java.awt")

[createImage](../../java/awt/Toolkit.html#createImage-byte:A-int-int-)(byte[] imagedata, int imageoffset, int imagelength)

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

abstract [Image](../../java/awt/Image.html "class in java.awt")

[createImage](../../java/awt/Toolkit.html#createImage-java.awt.image.ImageProducer-)([ImageProducer](../../java/awt/image/ImageProducer.html "interface in java.awt.image") producer)

Creates an image with the specified image producer.

abstract [Image](../../java/awt/Image.html "class in java.awt")

[createImage](../../java/awt/Toolkit.html#createImage-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") filename)

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

abstract [Image](../../java/awt/Image.html "class in java.awt")

[createImage](../../java/awt/Toolkit.html#createImage-java.net.URL-)([URL](../../java/net/URL.html "class in java.net") url)

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

protected abstract java.awt.peer.LabelPeer

[createLabel](../../java/awt/Toolkit.html#createLabel-java.awt.Label-)([Label](../../java/awt/Label.html "class in java.awt") target)

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

protected abstract java.awt.peer.ListPeer

[createList](../../java/awt/Toolkit.html#createList-java.awt.List-)([List](../../java/awt/List.html "class in java.awt") target)

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

protected abstract java.awt.peer.MenuPeer

[createMenu](../../java/awt/Toolkit.html#createMenu-java.awt.Menu-)([Menu](../../java/awt/Menu.html "class in java.awt") target)

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

protected abstract java.awt.peer.MenuBarPeer

[createMenuBar](../../java/awt/Toolkit.html#createMenuBar-java.awt.MenuBar-)([MenuBar](../../java/awt/MenuBar.html "class in java.awt") target)

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

protected abstract java.awt.peer.MenuItemPeer

[createMenuItem](../../java/awt/Toolkit.html#createMenuItem-java.awt.MenuItem-)([MenuItem](../../java/awt/MenuItem.html "class in java.awt") target)

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

protected abstract java.awt.peer.PanelPeer

[createPanel](../../java/awt/Toolkit.html#createPanel-java.awt.Panel-)([Panel](../../java/awt/Panel.html "class in java.awt") target)

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

protected abstract java.awt.peer.PopupMenuPeer

[createPopupMenu](../../java/awt/Toolkit.html#createPopupMenu-java.awt.PopupMenu-)([PopupMenu](../../java/awt/PopupMenu.html "class in java.awt") target)

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

protected abstract java.awt.peer.ScrollbarPeer

[createScrollbar](../../java/awt/Toolkit.html#createScrollbar-java.awt.Scrollbar-)([Scrollbar](../../java/awt/Scrollbar.html "class in java.awt") target)

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

protected abstract java.awt.peer.ScrollPanePeer

[createScrollPane](../../java/awt/Toolkit.html#createScrollPane-java.awt.ScrollPane-)([ScrollPane](../../java/awt/ScrollPane.html "class in java.awt") target)

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

protected abstract java.awt.peer.TextAreaPeer

[createTextArea](../../java/awt/Toolkit.html#createTextArea-java.awt.TextArea-)([TextArea](../../java/awt/TextArea.html "class in java.awt") target)

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

protected abstract java.awt.peer.TextFieldPeer

[createTextField](../../java/awt/Toolkit.html#createTextField-java.awt.TextField-)([TextField](../../java/awt/TextField.html "class in java.awt") target)

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

protected abstract java.awt.peer.WindowPeer

[createWindow](../../java/awt/Toolkit.html#createWindow-java.awt.Window-)([Window](../../java/awt/Window.html "class in java.awt") target)

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

[AWTEventListener](../../java/awt/event/AWTEventListener.html "interface in java.awt.event")[]

[getAWTEventListeners](../../java/awt/Toolkit.html#getAWTEventListeners--)()

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

[AWTEventListener](../../java/awt/event/AWTEventListener.html "interface in java.awt.event")[]

[getAWTEventListeners](../../java/awt/Toolkit.html#getAWTEventListeners-long-)(long eventMask)

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

[Dimension](../../java/awt/Dimension.html "class in java.awt")

[getBestCursorSize](../../java/awt/Toolkit.html#getBestCursorSize-int-int-)(int preferredWidth, int preferredHeight)

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

abstract [ColorModel](../../java/awt/image/ColorModel.html "class in java.awt.image")

[getColorModel](../../java/awt/Toolkit.html#getColorModel--)()

Determines the color model of this toolkit's screen.

static [Toolkit](../../java/awt/Toolkit.html "class in java.awt")

[getDefaultToolkit](../../java/awt/Toolkit.html#getDefaultToolkit--)()

Gets the default toolkit.

[Object](../../java/lang/Object.html "class in java.lang")

[getDesktopProperty](../../java/awt/Toolkit.html#getDesktopProperty-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") propertyName)

Obtains a value for the specified desktop property.

abstract [String](../../java/lang/String.html "class in java.lang")[]

[getFontList](../../java/awt/Toolkit.html#getFontList--)()

abstract [FontMetrics](../../java/awt/FontMetrics.html "class in java.awt")

[getFontMetrics](../../java/awt/Toolkit.html#getFontMetrics-java.awt.Font-)([Font](../../java/awt/Font.html "class in java.awt") font)

protected abstract java.awt.peer.FontPeer

[getFontPeer](../../java/awt/Toolkit.html#getFontPeer-java.lang.String-int-)([String](../../java/lang/String.html "class in java.lang") name, int style)

abstract [Image](../../java/awt/Image.html "class in java.awt")

[getImage](../../java/awt/Toolkit.html#getImage-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") filename)

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

abstract [Image](../../java/awt/Image.html "class in java.awt")

[getImage](../../java/awt/Toolkit.html#getImage-java.net.URL-)([URL](../../java/net/URL.html "class in java.net") url)

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

boolean

[getLockingKeyState](../../java/awt/Toolkit.html#getLockingKeyState-int-)(int keyCode)

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

int

[getMaximumCursorColors](../../java/awt/Toolkit.html#getMaximumCursorColors--)()

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

int

[getMenuShortcutKeyMask](../../java/awt/Toolkit.html#getMenuShortcutKeyMask--)()

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

protected java.awt.peer.MouseInfoPeer

[getMouseInfoPeer](../../java/awt/Toolkit.html#getMouseInfoPeer--)()

Obtains this toolkit's implementation of helper class forMouseInfo operations.

protected static [Container](../../java/awt/Container.html "class in java.awt")

[getNativeContainer](../../java/awt/Toolkit.html#getNativeContainer-java.awt.Component-)([Component](../../java/awt/Component.html "class in java.awt") c)

Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).

[PrintJob](../../java/awt/PrintJob.html "class in java.awt")

[getPrintJob](../../java/awt/Toolkit.html#getPrintJob-java.awt.Frame-java.lang.String-java.awt.JobAttributes-java.awt.PageAttributes-)([Frame](../../java/awt/Frame.html "class in java.awt") frame,[String](../../java/lang/String.html "class in java.lang") jobtitle,[JobAttributes](../../java/awt/JobAttributes.html "class in java.awt") jobAttributes,[PageAttributes](../../java/awt/PageAttributes.html "class in java.awt") pageAttributes)

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

abstract [PrintJob](../../java/awt/PrintJob.html "class in java.awt")

[getPrintJob](../../java/awt/Toolkit.html#getPrintJob-java.awt.Frame-java.lang.String-java.util.Properties-)([Frame](../../java/awt/Frame.html "class in java.awt") frame,[String](../../java/lang/String.html "class in java.lang") jobtitle,[Properties](../../java/util/Properties.html "class in java.util") props)

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

static [String](../../java/lang/String.html "class in java.lang")

[getProperty](../../java/awt/Toolkit.html#getProperty-java.lang.String-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") key,[String](../../java/lang/String.html "class in java.lang") defaultValue)

Gets a property with the specified key and default.

[PropertyChangeListener](../../java/beans/PropertyChangeListener.html "interface in java.beans")[]

[getPropertyChangeListeners](../../java/awt/Toolkit.html#getPropertyChangeListeners--)()

Returns an array of all the property change listeners registered on this toolkit.

[PropertyChangeListener](../../java/beans/PropertyChangeListener.html "interface in java.beans")[]

[getPropertyChangeListeners](../../java/awt/Toolkit.html#getPropertyChangeListeners-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") propertyName)

Returns an array of all property change listeners associated with the specified name of a desktop property.

[Insets](../../java/awt/Insets.html "class in java.awt")

[getScreenInsets](../../java/awt/Toolkit.html#getScreenInsets-java.awt.GraphicsConfiguration-)([GraphicsConfiguration](../../java/awt/GraphicsConfiguration.html "class in java.awt") gc)

Gets the insets of the screen.

abstract int

[getScreenResolution](../../java/awt/Toolkit.html#getScreenResolution--)()

Returns the screen resolution in dots-per-inch.

abstract [Dimension](../../java/awt/Dimension.html "class in java.awt")

[getScreenSize](../../java/awt/Toolkit.html#getScreenSize--)()

Gets the size of the screen.

abstract [Clipboard](../../java/awt/datatransfer/Clipboard.html "class in java.awt.datatransfer")

[getSystemClipboard](../../java/awt/Toolkit.html#getSystemClipboard--)()

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

[EventQueue](../../java/awt/EventQueue.html "class in java.awt")

[getSystemEventQueue](../../java/awt/Toolkit.html#getSystemEventQueue--)()

Get the application's or applet's EventQueue instance.

protected abstract [EventQueue](../../java/awt/EventQueue.html "class in java.awt")

[getSystemEventQueueImpl](../../java/awt/Toolkit.html#getSystemEventQueueImpl--)()

Gets the application's or applet's EventQueue instance, without checking access.

[Clipboard](../../java/awt/datatransfer/Clipboard.html "class in java.awt.datatransfer")

[getSystemSelection](../../java/awt/Toolkit.html#getSystemSelection--)()

Gets the singleton instance of the system selection as aClipboard object.

protected void

[initializeDesktopProperties](../../java/awt/Toolkit.html#initializeDesktopProperties--)()

initializeDesktopProperties

boolean

[isAlwaysOnTopSupported](../../java/awt/Toolkit.html#isAlwaysOnTopSupported--)()

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

boolean

[isDynamicLayoutActive](../../java/awt/Toolkit.html#isDynamicLayoutActive--)()

Returns whether dynamic layout of Containers on resize is currently active (both set in program ( isDynamicLayoutSet() ) , and supported by the underlying operating system and/or window manager).

protected boolean

[isDynamicLayoutSet](../../java/awt/Toolkit.html#isDynamicLayoutSet--)()

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

boolean

[isFrameStateSupported](../../java/awt/Toolkit.html#isFrameStateSupported-int-)(int state)

Returns whether Toolkit supports this state forFrames.

abstract boolean

[isModalExclusionTypeSupported](../../java/awt/Toolkit.html#isModalExclusionTypeSupported-java.awt.Dialog.ModalExclusionType-)([Dialog.ModalExclusionType](../../java/awt/Dialog.ModalExclusionType.html "enum in java.awt") modalExclusionType)

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

abstract boolean

[isModalityTypeSupported](../../java/awt/Toolkit.html#isModalityTypeSupported-java.awt.Dialog.ModalityType-)([Dialog.ModalityType](../../java/awt/Dialog.ModalityType.html "enum in java.awt") modalityType)

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

protected [Object](../../java/lang/Object.html "class in java.lang")

[lazilyLoadDesktopProperty](../../java/awt/Toolkit.html#lazilyLoadDesktopProperty-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") name)

an opportunity to lazily evaluate desktop property values.

protected void

[loadSystemColors](../../java/awt/Toolkit.html#loadSystemColors-int:A-)(int[] systemColors)

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

abstract [Map](../../java/util/Map.html "interface in java.util")<[TextAttribute](../../java/awt/font/TextAttribute.html "class in java.awt.font"),?>

[mapInputMethodHighlight](../../java/awt/Toolkit.html#mapInputMethodHighlight-java.awt.im.InputMethodHighlight-)([InputMethodHighlight](../../java/awt/im/InputMethodHighlight.html "class in java.awt.im") highlight)

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

abstract boolean

[prepareImage](../../java/awt/Toolkit.html#prepareImage-java.awt.Image-int-int-java.awt.image.ImageObserver-)([Image](../../java/awt/Image.html "class in java.awt") image, int width, int height,[ImageObserver](../../java/awt/image/ImageObserver.html "interface in java.awt.image") observer)

Prepares an image for rendering.

void

[removeAWTEventListener](../../java/awt/Toolkit.html#removeAWTEventListener-java.awt.event.AWTEventListener-)([AWTEventListener](../../java/awt/event/AWTEventListener.html "interface in java.awt.event") listener)

Removes an AWTEventListener from receiving dispatched AWTEvents.

void

[removePropertyChangeListener](../../java/awt/Toolkit.html#removePropertyChangeListener-java.lang.String-java.beans.PropertyChangeListener-)([String](../../java/lang/String.html "class in java.lang") name,[PropertyChangeListener](../../java/beans/PropertyChangeListener.html "interface in java.beans") pcl)

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

protected void

[setDesktopProperty](../../java/awt/Toolkit.html#setDesktopProperty-java.lang.String-java.lang.Object-)([String](../../java/lang/String.html "class in java.lang") name,[Object](../../java/lang/Object.html "class in java.lang") newValue)

Sets the named desktop property to the specified value and fires a property change event to notify any listeners that the value has changed.

void

[setDynamicLayout](../../java/awt/Toolkit.html#setDynamicLayout-boolean-)(boolean dynamic)

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

void

[setLockingKeyState](../../java/awt/Toolkit.html#setLockingKeyState-int-boolean-)(int keyCode, boolean on)

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

abstract void

[sync](../../java/awt/Toolkit.html#sync--)()

Synchronizes this toolkit's graphics state.