The abstract Toolkit class provides access to platform-specific details like window size and available fonts. It also deals with creating all the components' peer objects when you call addNotify().
public abstract class java.awt.Toolkit extends java.lang.Object { // Class Methods public static synchronized Toolkit getDefaultToolkit(); protected static Container getNativeContainer (Component c); public static String getProperty (String key, String defaultValue); // Instance Methods public abstract void beep(); public abstract int checkImage (Image image, int width, int height, ImageObserver observer); public abstract Image createImage (ImageProducer producer); public Image createImage (byte[] imagedata); public abstract Image createImage (byte[ ] imagedata, int imageoffset, int imagelength); public abstract ColorModel getColorModel(); public abstract String[] getFontList(); public abstract FontMetrics getFontMetrics (Font font); public abstract Image getImage (String filename); public abstract Image getImage (URL url); public int getMenuShortcutKeyMask(); public abstract PrintJob getPrintJob (Frame frame, String jobtitle, Properties props); public abstract int getScreenResolution(); public abstract Dimension getScreenSize(); public abstract Clipboard getSystemClipboard(); public final EventQueue getSystemEventQueue(); public abstract boolean prepareImage (Image image, int width, int height, ImageObserver observer); public abstract void sync(); // Protected Instance Methods protected abstract ButtonPeer createButton (Button b); protected abstract CanvasPeer createCanvas (Canvas c); protected abstract CheckboxPeer createCheckbox (Checkbox cb); protected abstract CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi); protected abstract ChoicePeer createChoice (Choice c); protected LightweightPeer createComponent(Component target); protected abstract DialogPeer createDialog (Dialog d); protected abstract FileDialogPeer createFileDialog (FileDialog fd); protected abstract FramePeer createFrame (Frame f); protected abstract LabelPeer createLabel (Label l); protected abstract ListPeer createList (List l); protected abstract MenuPeer createMenu (Menu m); protected abstract MenuBarPeer createMenuBar (MenuBar mb); protected abstract MenuItemPeer createMenuItem (MenuItem mi); protected abstract PanelPeer createPanel (Panel p); protected abstract PopupMenuPeer createPopupMenu (PopupMenu target); protected abstract ScrollPanePeer createScrollPane (ScrollPane target); protected abstract ScrollbarPeer createScrollbar (Scrollbar sb); protected abstract TextAreaPeer createTextArea (TextArea ta); protected abstract TextFieldPeer createTextField (TextField tf); protected abstract WindowPeer createWindow (Window w); protected abstract FontPeer getFontPeer (String name, int style); protected abstract EventQueue getSystemEventQueueImpl(); protected void loadSystemColors (int[] systemColors); }
If the toolkit for the current platform cannot be found.
The system's default Toolkit.
The native container for the given component. The component's immediate parent may be a lightweight component.
The name of a property.
A default value to return if the property is not found.
The value of the property described by key, or defaultValue if it is not found.
Produces an audible beep.
Image to check.
Width of the scaled image; -1 if image will be rendered unscaled.
Height of the scaled image; -1 if image will be rendered unscaled.
The Component that image will be rendered on.
The ImageObserver flags ORed together for the data that is now available.
Checks on the status of the construction of a screen representation of image on observer.
An ImageProducer that generates data for the desired image.
Newly created Image.
Creates a new Image from an ImageProducer.
Raw data representing an image.
Newly created Image.
Creates a new Image from the imagedata provided.
Raw data representing one or more images.
An offset into the data given.
The length of data to use.
Newly created Image.
Creates a new Image from the imagedata provided, starting at imageoffset bytes and reading imagelength bytes.
The current ColorModel used by the system.
A String array of the set of Java fonts available with this Toolkit.
A Font whose metrics are desired
The current FontMetrics for the font on the user's system.
Location of Image on local filesystem
The Image that needs to be fetched.
Fetches an image from the local file system.
Location of Image.
The Image that needs to be fetched.
Fetches an image from a URL.
The modifier key mask used for menu shortcuts. This will be one of the mask constants defined in java.awt.Event.
The frame to be used as the parent of a platform-specific printing dialog.
The name of the job.
Properties for this print job.
A PrintJob object. If the user canceled the printing operation, null is returned.
The current resolution of the user's screen, in dots-per-inch.
The size of the screen available to the Toolkit, in pixels, as a Dimension object.
A Clipboard object that can be used for cut, copy, and paste operations.
A reference to the system's event queue, allowing the program to post new events or inspect the queue.
Image to check.
Width of the scaled image; -1 if image will be rendered unscaled.
Height of the scaled image; -1 if image will be rendered unscaled.
The Component that image will be rendered on.
true if image fully loaded, false otherwise.
Forces the system to start loading the image.
Flushes the display of the underlying graphics context.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Button.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Canvas.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Checkbox.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the CheckboxMenuItem.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Choice.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Component.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Dialog.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the FileDialog.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Frame.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Label.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the List.
Menu whose peer needs to be created.
Newly created peer.
Creates a peer for the given Menu.
MenuBar whose peer needs to be created.
Newly created peer.
Creates a peer for the MenuBar.
MenuItem whose peer needs to be created.
Newly created peer.
Creates a peer for the MenuItem.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Panel.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the PopupMenu.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the ScrollPane.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Scrollbar.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the TextArea.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the TextField.
Component whose peer needs to be created.
Newly created peer.
Creates a peer for the Window.
Name of the font to be created.
Style of the font to be created.
Newly created peer.
Creates a FontPeer.
A toolkit-specific EventQueue object.
Fills the given integer array with the current system colors.
Button, ButtonPeer, Canvas, CanvasPeer, Checkbox, CheckboxMenuItem, CheckboxMenuItemPeer, CheckboxPeer, Choice, ChoicePeer, Clipboard, ColorModel, Component, Container, Dialog, DialogPeer, Dimension, FileDialog, FileDialogPeer, Font, FontMetrics, FontPeer, Frame, FramePeer, Image, ImageObserver, ImageProducer, Label, LabelPeer, LightweightPeer, List, ListPeer, Menu, MenuBar, MenuBarPeer, MenuItem, MenuItemPeer, MenuPeer, Panel, PanelPeer, PrintJob, Scrollbar, ScrollbarPeer, ScrollPane, ScrollPanePeer, String, TextArea, TextAreaPeer, TextField, TextFieldPeer, Window, WindowPeer