All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Toolkit

java.lang.Object
   |
   +----java.awt.Toolkit

public abstract class Toolkit
extends Object
An AWT toolkit. It is used to bind the abstract AWT classes to a particular native toolkit implementation.


Constructor Index

 o Toolkit()

Method Index

 o beep()
Emits an audio beep.
 o checkImage(Image, int, int, ImageObserver)
Returns the status of the construction of the indicated method at the indicated width and height for the default screen.
 o createButton(Button)
Uses the specified Peer interface to create a new Button.
 o createCanvas(Canvas)
Uses the specified Peer interface to create a new Canvas.
 o createCheckbox(Checkbox)
Uses the specified Peer interface to create a new Checkbox.
 o createCheckboxMenuItem(CheckboxMenuItem)
Uses the specified Peer interface to create a new CheckboxMenuItem.
 o createChoice(Choice)
Uses the specified Peer interface to create a new Choice.
 o createComponent(Component)
Creates a peer for a component or container.
 o createDialog(Dialog)
Uses the specified Peer interface to create a new Dialog.
 o createFileDialog(FileDialog)
Uses the specified Peer interface to create a new FileDialog.
 o createFrame(Frame)
Uses the specified Peer interface to create a new Frame.
 o createImage(byte[])
Creates an image which decodes the image stored in the specified byte array.
 o createImage(byte[], int, int)
Creates an image which decodes the image stored in the specified byte array at the specified offset and length.
 o createImage(ImageProducer)
Creates an image with the specified image producer.
 o createLabel(Label)
Uses the specified Peer interface to create a new Label.
 o createList(List)
Uses the specified Peer interface to create a new List.
 o createMenu(Menu)
Uses the specified Peer interface to create a new Menu.
 o createMenuBar(MenuBar)
Uses the specified Peer interface to create a new MenuBar.
 o createMenuItem(MenuItem)
Uses the specified Peer interface to create a new MenuItem.
 o createPanel(Panel)
Uses the specified Peer interface to create a new Panel.
 o createPopupMenu(PopupMenu)
Uses the specified Peer interface to create a new PopupMenu.
 o createScrollbar(Scrollbar)
Uses the specified Peer interface to create a new Scrollbar.
 o createScrollPane(ScrollPane)
Uses the specified Peer interface to create a new scrolling container.
 o createTextArea(TextArea)
Uses the specified Peer interface to create a new TextArea.
 o createTextField(TextField)
Uses the specified Peer interface to create a new TextField.
 o createWindow(Window)
Uses the specified Peer interface to create a new Window.
 o getColorModel()
Returns the ColorModel of the screen.
 o getDefaultToolkit()
Returns the default toolkit.
 o getFontList()
Returns the names of the available fonts.

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

The ZapfDingbats font is also deprecated in 1.1, but only as a separate fontname.

 o getFontMetrics(Font)
Returns the screen metrics of the font.
 o getFontPeer(String, int)
Uses the specified Peer interface to create a new Font.
 o getImage(String)
Returns an image which gets pixel data from the specified file.
 o getImage(URL)
Returns an image which gets pixel data from the specified URL.
 o getMenuShortcutKeyMask()
Return the Event modifier mask appropriate for shortcuts.
 o getNativeContainer(Component)
Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).
 o getPrintJob(Frame, String, Properties)
Returns a PrintJob object which is the result of initiating a print operation on the toolkit's platform.
 o getProperty(String, String)
Gets a property with the specified key and default.
 o getScreenResolution()
Returns the screen resolution in dots-per-inch.
 o getScreenSize()
Gets the size of the screen.
 o getSystemClipboard()
Returns an instance of the "system" clipboard which interfaces with the clipboard facilities on the native platform.
 o getSystemEventQueue()
Get the application's or applet's EventQueue instance.
 o getSystemEventQueueImpl()
 o loadSystemColors(int[])
Fills in the provided int array with the current system color values
 o prepareImage(Image, int, int, ImageObserver)
Prepares an image for rendering on the default screen at the specified width and height.
 o sync()
Syncs the graphics state; useful when doing animation.

Constructors

 o Toolkit
 public Toolkit()

Methods

 o createButton
 protected abstract ButtonPeer createButton(Button target)
Uses the specified Peer interface to create a new Button.

Parameters:
target - the Button to be created
 o createTextField
 protected abstract TextFieldPeer createTextField(TextField target)
Uses the specified Peer interface to create a new TextField.

Parameters:
target - the TextField to be created
 o createLabel
 protected abstract LabelPeer createLabel(Label target)
Uses the specified Peer interface to create a new Label.

Parameters:
target - the Label to be created
 o createList
 protected abstract ListPeer createList(List target)
Uses the specified Peer interface to create a new List.

Parameters:
target - the List to be created
 o createCheckbox
 protected abstract CheckboxPeer createCheckbox(Checkbox target)
Uses the specified Peer interface to create a new Checkbox.

Parameters:
target - the Checkbox to be created
 o createScrollbar
 protected abstract ScrollbarPeer createScrollbar(Scrollbar target)
Uses the specified Peer interface to create a new Scrollbar.

Parameters:
target - the Scrollbar to be created
 o createScrollPane
 protected abstract ScrollPanePeer createScrollPane(ScrollPane target)
Uses the specified Peer interface to create a new scrolling container.

Parameters:
target - the ScrollPane to be created
 o createTextArea
 protected abstract TextAreaPeer createTextArea(TextArea target)
Uses the specified Peer interface to create a new TextArea.

Parameters:
target - the TextArea to be created
 o createChoice
 protected abstract ChoicePeer createChoice(Choice target)
Uses the specified Peer interface to create a new Choice.

Parameters:
target - the Choice to be created
 o createFrame
 protected abstract FramePeer createFrame(Frame target)
Uses the specified Peer interface to create a new Frame.

Parameters:
target - the Frame to be created
 o createCanvas
 protected abstract CanvasPeer createCanvas(Canvas target)
Uses the specified Peer interface to create a new Canvas.

Parameters:
target - the Canvas to be created
 o createPanel
 protected abstract PanelPeer createPanel(Panel target)
Uses the specified Peer interface to create a new Panel.

Parameters:
target - the Panel to be created
 o createWindow
 protected abstract WindowPeer createWindow(Window target)
Uses the specified Peer interface to create a new Window.

Parameters:
target - the Window to be created
 o createDialog
 protected abstract DialogPeer createDialog(Dialog target)
Uses the specified Peer interface to create a new Dialog.

Parameters:
target - the Dialog to be created
 o createMenuBar
 protected abstract MenuBarPeer createMenuBar(MenuBar target)
Uses the specified Peer interface to create a new MenuBar.

Parameters:
target - the MenuBar to be created
 o createMenu
 protected abstract MenuPeer createMenu(Menu target)
Uses the specified Peer interface to create a new Menu.

Parameters:
target - the Menu to be created
 o createPopupMenu
 protected abstract PopupMenuPeer createPopupMenu(PopupMenu target)
Uses the specified Peer interface to create a new PopupMenu.

Parameters:
target - the PopupMenu to be created
 o createMenuItem
 protected abstract MenuItemPeer createMenuItem(MenuItem target)
Uses the specified Peer interface to create a new MenuItem.

Parameters:
target - the MenuItem to be created
 o createFileDialog
 protected abstract FileDialogPeer createFileDialog(FileDialog target)
Uses the specified Peer interface to create a new FileDialog.

Parameters:
target - the FileDialog to be created
 o createCheckboxMenuItem
 protected abstract CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
Uses the specified Peer interface to create a new CheckboxMenuItem.

Parameters:
target - the CheckboxMenuItem to be created
 o createComponent
 protected LightweightPeer createComponent(Component target)
Creates a peer for a component or container. This peer is windowless and allows the Component and Container classes to be extended directly to create windowless components that are defined entirely in java.

Parameters:
target - The Component to be created.
 o getFontPeer
 protected abstract FontPeer getFontPeer(String name,
                                         int style)
Uses the specified Peer interface to create a new Font.

Parameters:
name - the font name
style - style the constant style used
 o loadSystemColors
 protected void loadSystemColors(int systemColors[])
Fills in the provided int array with the current system color values

 o getScreenSize
 public abstract Dimension getScreenSize()
Gets the size of the screen.

 o getScreenResolution
 public abstract int getScreenResolution()
Returns the screen resolution in dots-per-inch.

 o getColorModel
 public abstract ColorModel getColorModel()
Returns the ColorModel of the screen.

 o getFontList
 public abstract String[] getFontList()
Returns the names of the available fonts.

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

The ZapfDingbats font is also deprecated in 1.1, but only as a separate fontname. Unicode defines the ZapfDingbat characters starting at ?, and as of 1.1 Java supports those characters.

 o getFontMetrics
 public abstract FontMetrics getFontMetrics(Font font)
Returns the screen metrics of the font.

 o sync
 public abstract void sync()
Syncs the graphics state; useful when doing animation.

 o getDefaultToolkit
 public static synchronized Toolkit getDefaultToolkit()
Returns the default toolkit. This is controlled by the "awt.toolkit" property.

Throws: AWTError
Toolkit not found or could not be instantiated.
 o getImage
 public abstract Image getImage(String filename)
Returns an image which gets pixel data from the specified file.

Parameters:
filename - the file containing the pixel data in one of the recognized file formats
 o getImage
 public abstract Image getImage(URL url)
Returns an image which gets pixel data from the specified URL.

Parameters:
url - the URL to use in fetching the pixel data
 o prepareImage
 public abstract boolean prepareImage(Image image,
                                      int width,
                                      int height,
                                      ImageObserver observer)
Prepares an image for rendering on the default screen at the specified width and height.

 o checkImage
 public abstract int checkImage(Image image,
                                int width,
                                int height,
                                ImageObserver observer)
Returns the status of the construction of the indicated method at the indicated width and height for the default screen.

 o createImage
 public abstract Image createImage(ImageProducer producer)
Creates an image with the specified image producer.

Parameters:
producer - the image producer to be used
 o createImage
 public Image createImage(byte imagedata[])
Creates an image which decodes the image stored in the specified byte array. The data must be in some image format supported by the toolkit (such as GIF or JPEG).

Parameters:
imagedata - the array of image data in a supported image format
 o createImage
 public abstract Image createImage(byte imagedata[],
                                   int imageoffset,
                                   int imagelength)
Creates an image which decodes the image stored in the specified byte array at the specified offset and length. The data must be in some image format supported by the toolkit (such as GIF or JPEG).

Parameters:
imagedata - the array of image data in a supported image format
imageoffset - the offset of the start of the data in the array
imagelength - the length of the data in the array
 o getPrintJob
 public abstract PrintJob getPrintJob(Frame frame,
                                      String jobtitle,
                                      Properties props)
Returns a PrintJob object which is the result of initiating a print operation on the toolkit's platform. Returns null if the user cancelled print job.

 o beep
 public abstract void beep()
Emits an audio beep.

 o getSystemClipboard
 public abstract Clipboard getSystemClipboard()
Returns an instance of the "system" clipboard which interfaces with the clipboard facilities on the native platform. This clipboard enables data transfer between java programs and native platform applications which use these native clipboard facilities.

 o getMenuShortcutKeyMask
 public int getMenuShortcutKeyMask()
Return the Event modifier mask appropriate for shortcuts. Toolkit implementation should override this method if the CONTROL key isn't the correct key for accelerators.

 o getNativeContainer
 protected static Container getNativeContainer(Component c)
Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).

 o getProperty
 public static String getProperty(String key,
                                  String defaultValue)
Gets a property with the specified key and default. This method returns defaultValue if the property is not found.

 o getSystemEventQueue
 public final EventQueue getSystemEventQueue()
Get the application's or applet's EventQueue instance. Depending on the Toolkit implementation, different EventQueues may be returned for different applets. Applets should therefore not assume that the EventQueue instance returned by this method will be shared by other applets or the system.

 o getSystemEventQueueImpl
 protected abstract EventQueue getSystemEventQueueImpl()

All Packages  Class Hierarchy  This Package  Previous  Next  Index