All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.Toolkit
java.lang.Object
|
+----java.awt.Toolkit
- public class Toolkit
- extends Object
An AWT toolkit. It is used to bind the abstract AWT classes
to a particular native toolkit implementation.
-
Toolkit()
-
-
beep()
- Emits an audio beep.
-
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.
-
createButton(Button)
- Uses the specified Peer interface to create a new Button.
-
createCanvas(Canvas)
- Uses the specified Peer interface to create a new Canvas.
-
createCheckbox(Checkbox)
- Uses the specified Peer interface to create a new Checkbox.
-
createCheckboxMenuItem(CheckboxMenuItem)
- Uses the specified Peer interface to create a new CheckboxMenuItem.
-
createChoice(Choice)
- Uses the specified Peer interface to create a new Choice.
-
createComponent(Component)
- Creates a peer for a component or container.
-
createDialog(Dialog)
- Uses the specified Peer interface to create a new Dialog.
-
createFileDialog(FileDialog)
- Uses the specified Peer interface to create a new FileDialog.
-
createFrame(Frame)
- Uses the specified Peer interface to create a new Frame.
-
createImage(byte[])
- Creates an image which decodes the image stored in the specified
byte array.
-
createImage(byte[], int, int)
- Creates an image which decodes the image stored in the specified
byte array at the specified offset and length.
-
createImage(ImageProducer)
- Creates an image with the specified image producer.
-
createLabel(Label)
- Uses the specified Peer interface to create a new Label.
-
createList(List)
- Uses the specified Peer interface to create a new List.
-
createMenu(Menu)
- Uses the specified Peer interface to create a new Menu.
-
createMenuBar(MenuBar)
- Uses the specified Peer interface to create a new MenuBar.
-
createMenuItem(MenuItem)
- Uses the specified Peer interface to create a new MenuItem.
-
createPanel(Panel)
- Uses the specified Peer interface to create a new Panel.
-
createPopupMenu(PopupMenu)
- Uses the specified Peer interface to create a new PopupMenu.
-
createScrollbar(Scrollbar)
- Uses the specified Peer interface to create a new Scrollbar.
-
createScrollPane(ScrollPane)
- Uses the specified Peer interface to create a new scrolling container.
-
createTextArea(TextArea)
- Uses the specified Peer interface to create a new TextArea.
-
createTextField(TextField)
- Uses the specified Peer interface to create a new TextField.
-
createWindow(Window)
- Uses the specified Peer interface to create a new Window.
-
getColorModel()
- Returns the ColorModel of the screen.
-
getDefaultToolkit()
- Returns the default toolkit.
-
getFontList()
- Returns the names of the available fonts.
For 1.1, the following font names are deprecated (the replacement
name follows):
- TimesRoman (use Serif)
- Helvetica (use SansSerif)
- Courier (use Monospaced)
The ZapfDingbats font is also deprecated in 1.1, but only as a
separate fontname.
-
getFontMetrics(Font)
- Returns the screen metrics of the font.
-
getFontPeer(String, int)
- Uses the specified Peer interface to create a new Font.
-
getImage(String)
- Returns an image which gets pixel data from the specified file.
-
getImage(URL)
- Returns an image which gets pixel data from the specified URL.
-
getMenuShortcutKeyMask()
- Return the Event modifier mask appropriate for shortcuts.
-
getNativeContainer(Component)
- Give native peers the ability to query the native container
given a native component (eg the direct parent may be lightweight).
-
getPrintJob(Frame, String, Properties)
- Returns a PrintJob object which is the result of initiating
a print operation on the toolkit's platform.
-
getProperty(String, String)
- Gets a property with the specified key and default.
-
getScreenResolution()
- Returns the screen resolution in dots-per-inch.
-
getScreenSize()
- Gets the size of the screen.
-
getSystemClipboard()
- Returns an instance of the "system" clipboard which interfaces with
the clipboard facilities on the native platform.
-
getSystemEventQueue()
- Get the application's or applet's EventQueue instance.
-
getSystemEventQueueImpl()
-
-
loadSystemColors(int[])
- Fills in the provided int array with the current system color values
-
prepareImage(Image, int, int, ImageObserver)
- Prepares an image for rendering on the default screen at the
specified width and height.
-
sync()
- Syncs the graphics state; useful when doing animation.
Toolkit
method Toolkit() public
createButton
method createButton(target=Button) returns ButtonPeer Inheritable abstract
- Uses the specified Peer interface to create a new Button.
- Parameters:
- target - the Button to be created
createTextField
method createTextField(target=TextField) returns TextFieldPeer Inheritable abstract
- Uses the specified Peer interface to create a new TextField.
- Parameters:
- target - the TextField to be created
createLabel
method createLabel(target=Label) returns LabelPeer Inheritable abstract
- Uses the specified Peer interface to create a new Label.
- Parameters:
- target - the Label to be created
createList
method createList(target=List) returns ListPeer Inheritable abstract
- Uses the specified Peer interface to create a new List.
- Parameters:
- target - the List to be created
createCheckbox
method createCheckbox(target=Checkbox) returns CheckboxPeer Inheritable abstract
- Uses the specified Peer interface to create a new Checkbox.
- Parameters:
- target - the Checkbox to be created
createScrollbar
method createScrollbar(target=Scrollbar) returns ScrollbarPeer Inheritable abstract
- Uses the specified Peer interface to create a new Scrollbar.
- Parameters:
- target - the Scrollbar to be created
createScrollPane
method createScrollPane(target=ScrollPane) returns ScrollPanePeer Inheritable abstract
- Uses the specified Peer interface to create a new scrolling container.
- Parameters:
- target - the ScrollPane to be created
createTextArea
method createTextArea(target=TextArea) returns TextAreaPeer Inheritable abstract
- Uses the specified Peer interface to create a new TextArea.
- Parameters:
- target - the TextArea to be created
createChoice
method createChoice(target=Choice) returns ChoicePeer Inheritable abstract
- Uses the specified Peer interface to create a new Choice.
- Parameters:
- target - the Choice to be created
createFrame
method createFrame(target=Frame) returns FramePeer Inheritable abstract
- Uses the specified Peer interface to create a new Frame.
- Parameters:
- target - the Frame to be created
createCanvas
method createCanvas(target=Canvas) returns CanvasPeer Inheritable abstract
- Uses the specified Peer interface to create a new Canvas.
- Parameters:
- target - the Canvas to be created
createPanel
method createPanel(target=Panel) returns PanelPeer Inheritable abstract
- Uses the specified Peer interface to create a new Panel.
- Parameters:
- target - the Panel to be created
createWindow
method createWindow(target=Window) returns WindowPeer Inheritable abstract
- Uses the specified Peer interface to create a new Window.
- Parameters:
- target - the Window to be created
createDialog
method createDialog(target=Dialog) returns DialogPeer Inheritable abstract
- Uses the specified Peer interface to create a new Dialog.
- Parameters:
- target - the Dialog to be created
createMenuBar
method createMenuBar(target=MenuBar) returns MenuBarPeer Inheritable abstract
- Uses the specified Peer interface to create a new MenuBar.
- Parameters:
- target - the MenuBar to be created
createMenu
method createMenu(target=Menu) returns MenuPeer Inheritable abstract
- Uses the specified Peer interface to create a new Menu.
- Parameters:
- target - the Menu to be created
createPopupMenu
method createPopupMenu(target=PopupMenu) returns PopupMenuPeer Inheritable abstract
- Uses the specified Peer interface to create a new PopupMenu.
- Parameters:
- target - the PopupMenu to be created
createMenuItem
method createMenuItem(target=MenuItem) returns MenuItemPeer Inheritable abstract
- Uses the specified Peer interface to create a new MenuItem.
- Parameters:
- target - the MenuItem to be created
createFileDialog
method createFileDialog(target=FileDialog) returns FileDialogPeer Inheritable abstract
- Uses the specified Peer interface to create a new FileDialog.
- Parameters:
- target - the FileDialog to be created
createCheckboxMenuItem
method createCheckboxMenuItem(target=CheckboxMenuItem) returns CheckboxMenuItemPeer Inheritable abstract
- Uses the specified Peer interface to create a new CheckboxMenuItem.
- Parameters:
- target - the CheckboxMenuItem to be created
createComponent
method createComponent(target=Component) returns LightweightPeer Inheritable
- 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.
getFontPeer
method getFontPeer(name=String, -
style=int) returns FontPeer Inheritable abstract
- Uses the specified Peer interface to create a new Font.
- Parameters:
- name - the font name
- style - style the constant style used
loadSystemColors
method loadSystemColors(systemColors=int[]) Inheritable
- Fills in the provided int array with the current system color values
getScreenSize
method getScreenSize() returns Dimension public abstract
- Gets the size of the screen.
getScreenResolution
method getScreenResolution() returns int public abstract
- Returns the screen resolution in dots-per-inch.
getColorModel
method getColorModel() returns ColorModel public abstract
- Returns the ColorModel of the screen.
getFontList
method getFontList() returns String[] public abstract
- Returns the names of the available fonts.
For 1.1, the following font names are deprecated (the replacement
name follows):
- TimesRoman (use Serif)
- Helvetica (use SansSerif)
- Courier (use Monospaced)
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.
getFontMetrics
method getFontMetrics(font=Font) returns FontMetrics public abstract
- Returns the screen metrics of the font.
sync
method sync() public abstract
- Syncs the graphics state; useful when doing animation.
getDefaultToolkit
method getDefaultToolkit() returns Toolkit public static protect
- Returns the default toolkit. This is controlled by the
"awt.toolkit" property.
- Throws: AWTError
- Toolkit not found or could not be instantiated.
getImage
method getImage(filename=String) returns Image public abstract
- 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
getImage
method getImage(url=URL) returns Image public abstract
- Returns an image which gets pixel data from the specified URL.
- Parameters:
- url - the URL to use in fetching the pixel data
prepareImage
method prepareImage(image=Image, -
width=int, -
height=int, -
observer=ImageObserver) returns boolean public abstract
- Prepares an image for rendering on the default screen at the
specified width and height.
checkImage
method checkImage(image=Image, -
width=int, -
height=int, -
observer=ImageObserver) returns int public abstract
- Returns the status of the construction of the indicated method
at the indicated width and height for the default screen.
createImage
method createImage(producer=ImageProducer) returns Image public abstract
- Creates an image with the specified image producer.
- Parameters:
- producer - the image producer to be used
createImage
method createImage(imagedata=byte[]) returns Image public
- 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
createImage
method createImage(imagedata=byte[], -
imageoffset=int, -
imagelength=int) returns Image public abstract
- 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
getPrintJob
method getPrintJob(frame=Frame, -
jobtitle=String, -
props=Properties) returns PrintJob public abstract
- 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.
beep
method beep() public abstract
- Emits an audio beep.
getSystemClipboard
method getSystemClipboard() returns Clipboard public abstract
- 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.
getMenuShortcutKeyMask
method getMenuShortcutKeyMask() returns int public
- 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.
getNativeContainer
method getNativeContainer(c=Component) returns Container Inheritable static
- Give native peers the ability to query the native container
given a native component (eg the direct parent may be lightweight).
getProperty
method getProperty(key=String, -
defaultValue=String) returns String public static
- Gets a property with the specified key and default.
This method returns defaultValue if the property is not found.
getSystemEventQueue
method getSystemEventQueue() returns EventQueue public final
- 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.
getSystemEventQueueImpl
method getSystemEventQueueImpl() returns EventQueue Inheritable abstract
All Packages Class Hierarchy This Package Previous Next Index