|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejava.awtas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Thrown when a serious Abstract Window Toolkit error has occurred. @version 1.12 0213 12/0203/0001 @author Arthur van Hoff
The root event class for all AWT events. This class and its subclasses supercede the original java.awt.Event class. Subclasses of this root AWTEvent class defined outside of the java.awt.event package should define event ID values greater than the value defined by RESERVED_ID_MAX.Class AWTEvent, String paramString()The event masks defined in this class are needed by Component subclasses which are using Component.enableEvents() to select for event types not selected by registered listeners. If a listener is registered on a component the appropriate event mask is already set internally by the component.
The masks are also used to specify to which types of events an AWTEventListener should listen. The masks are bitwise-ORed together and passed to Toolkit.addAWTEventListener. @see Component#enableEvents @see Toolkit#addAWTEventListener @see java.awt.event.ActionEvent @see java.awt.event.AdjustmentEvent @see java.awt.event.ComponentEvent @see java.awt.event.ContainerEvent @see java.awt.event.FocusEvent @see java.awt.event.InputMethodEvent @see java.awt.event.InvocationEvent @see java.awt.event.ItemEvent @see java.awt.event.HierarchyEvent @see java.awt.event.KeyEvent @see java.awt.event.MouseEvent @see java.awt.event.MouseWheelEvent @see java.awt.event.PaintEvent @see java.awt.event.TextEvent @see java.awt.event.WindowEvent @author Carl Quinn @author Amy Fowler @version 1.
38 0248 12/1103/0001 @since 1.1
Returns a string representing the state of thiseventEvent. This method is intended to be used only for debugging purposes and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull. @return a string representation of this event.
A class which implements efficient and thread-safe multi-cast event dispatching for the AWT events defined in the java.awt.event package. This class will manage an immutable structure consisting of a chain of event listeners and will dispatch events to those listeners. Because the structure is immutable it is safe to use this API to add/remove listeners during the process of an event dispatch operation. An example of how this class could be used to implement a new component which fires "action" events:@author John Rose @author Amy Fowler @version 1.public myComponent extends Component { ActionListener actionListener = null; public synchronized void addActionListener(ActionListener l) { actionListener = AWTEventMulticaster.add(actionListener l); } public synchronized void removeActionListener(ActionListener l) { actionListener = AWTEventMulticaster.remove(actionListener l); } public void processEvent(AWTEvent e) { // when event occurs which causes "action" semantic if (actionListener = null) { actionListener.actionPerformed(new ActionEvent()); } }25 0231 12/0203/0001 @since 1.1
Signals that an Absract Window Toolkit exception has occurred. @version 1.13 0214 12/0203/0001 @author Arthur van Hoff
This class is for AWT permissions. AnClass AWTPermission, constructor AWTPermission(String)AWTPermissioncontains a target name but no actions list; you either have the named permission or you don't.The target name is the name of the AWT permission (see below). The naming convention follows the hierarchical property naming convention. Also an asterisk could be used to represent all AWT permissions.
The following table lists all the possible
AWTPermissiontarget names and for each provides a description of what the permission allows and a discussion of the risks of granting code the permission.
@see java.security.BasicPermission @see java.security.Permission @see java.security.Permissions @see java.security.PermissionCollection @see java.lang.SecurityManager @version 1.
Permission Target Name What the Permission Allows Risks of Allowing this Permission accessClipboard Posting and retrieval of information to and from the AWT clipboard This would allow malfeasant code to share potentially sensitive or confidential information. accessEventQueue Access to the AWT event queue After retrieving the AWT event queue malicious code may peek at and even remove existing events from its event queue as well as post bogus events which may purposefully cause the application or applet to misbehave in an insecure manner. listenToAllAWTEvents Listen to all AWT events system-wide After adding an AWT event listener malicious code may scan all AWT events dispatched in the system allowing it to read all user input (such as passwords). Each AWT event listener is called from within the context of that event queue's EventDispatchThread so if the accessEventQueue permission is also enabled malicious code could modify the contents of AWT event queues system-wide causing the application or applet to misbehave in an insecure manner. showWindowWithoutWarningBanner Display of a window without also displaying a banner warning that the window was created by an applet Without this warning an applet may pop up windows without the user knowing that they belong to an applet. Since users may make security-sensitive decisions based on whether or not the window belongs to an applet (entering a username and password into a dialog box for example) disabling this warning banner may allow applets to trick the user into entering such information. readDisplayPixels Readback of pixels from the display screen Interfaces such as the java.awt.Composite interface or the java.awt.Robot class allow arbitrary code to examine pixels on the display enable malicious code to snoop on the activities of the user. createRobot Create java.awt.Robot objects The java.awt.Robot object allows code to generate native-level mouse and keyboard events as well as read the screen. It could allow malicious code to control the system run other programs read the display and deny mouse and keyboard access to the user. fullScreenExclusive Enter full-screen exclusive mode Entering full-screen exclusive mode allows direct access to low-level graphics card memory. This could be used to spoof the system since the program is in direct control of rendering. 18 0221 12/0203/0001 @author Marianne Mueller @author Roland Schemers
Creates a newClass AWTPermission, constructor AWTPermission(String, String)AWTPermissionwith the specified name. The name is the symbolic name of theAWTPermissionsuch as "topLevelWindow" "systemClipboard" etc. An asterisk may be used to indicate all AWT permissions. @param name the name of the AWTPermission.
Creates a newAWTPermissionobject with the specified name. The name is the symbolic name of theAWTPermissionand the actionsStringstring is currently unused and should benull. This constructor exists for use by thePolicyobject to instantiate newPermissionpermission objects. @param name the name of theAWTPermission@param actions should be.null.
An interface for events that know how dispatch themselves. By implementing this interface an event can be placed upon the event queue and itsdispatch()method will be called when the event is dispatched using theEventDispatchThread.This is a very useful mechanism for avoiding deadlocks. If a thread is executing in a critical section (i.e. it has entered one or more monitors) calling other synchronized code may cause deadlocks. To avoid the potential deadlocks an
ActiveEventcan be created to run the second section of code at later time. If there is contention on the monitor the second thread will simply block until the first thread has finished its work and exited its monitors.For security reasons it is often desirable to use an
ActiveEventto avoid calling untrusted code from a critical thread. For instance peer implementations can use this facility to avoid making calls into user code from a system thread. Doing so avoids potential deadlocks and denial-of-service attacks. @author Timothy Prinzing @version 1.9 0210 12/0203/0001 @since 1.2
The interface for objects which have an adjustable numeric value contained within a bounded range of values. @version 1.Class Adjustable, void addAdjustmentListener(AdjustmentListener)10 0214 12/0203/0001 @author Amy Fowler @author Tim Prinzing
Class Adjustable, int getBlockIncrement()AddAdds a listener torecievereceive adjustment events when the value of the adjustable object changes. @param l the listener torecievereceive events @see AdjustmentEvent
Gets the block value increment for the adjustable object. @return the block value increment for the adjustable objectClass Adjustable, int getMaximum()
Gets the maximum value of the adjustable object. @return the maximum value of the adjustable objectClass Adjustable, int getMinimum()
Gets the minimum value of the adjustable object. @return the minimum value of the adjustable objectClass Adjustable, int getOrientation()
Gets the orientation of the adjustable object. @return the orientation of the adjustable object; eitherClass Adjustable, int getUnitIncrement()HORIZONTALVERTICALorNO_ORIENTATION
Gets the unit value increment for the adjustable object. @return the unit value increment for the adjustable objectClass Adjustable, int getValue()
Gets the current value of the adjustable object. @return the current value of the adjustable objectClass Adjustable, int getVisibleAmount()
Gets the length of theClass Adjustable, void setVisibleAmount(int)propertionalproportional indicator. @return the length of the proportional indicator
Sets the length of theClass Adjustable, int HORIZONTALproportionlproportional indicator of the adjustable object. @param v the length of the indicator
Class Adjustable, int VERTICALTheIndicates that theAdjustablehas horizontal orientation.
TheIndicates that theAdjustablehas vertical orientation.
ThisClass AlphaComposite, AlphaComposite getInstance(int)AlphaCompositeclass implements the basic alpha compositing rules for combining source and destination pixels to achieve blending and transparency effects with graphics and images. The rules implemented by this class area subsetthe set ofthePorter-Duff rules described in T. Porter and T. Duff "Compositing Digital Images" SIGGRAPH 84 253-259.If any input does not have an alpha channel an alpha value of 1.0 which is completely opaque is assumed for all pixels. A constant alpha value can also be specified to be multiplied with the alpha value of the source pixels.
The following abbreviations are used in the description of the rules:
- Cs = one of the color components of the source pixel.
- Cd = one of the color components of the destination pixel.
- As = alpha component of the source pixel.
- Ad = alpha component of the destination pixel.
- Fs = fraction of the source pixel that contributes to the output.
- Fd = fraction of the input destination pixel that contributes to the output.
The color and alpha components produced by the compositing operation are calculated as follows:
Cd = Cs*Fs + Cd*Fd Ad = As*Fs + Ad*Fdwhere Fs and Fd are specified by each rule. The above equations assume that both source and destination pixels have the color components premultiplied by the alpha component. Similarly the equations expressed in the definitions of compositing rules below assume premultiplied alpha.For performance reasons it is preferrable that Rasters passed to the compose method of a CompositeContext object created by the
AlphaCompositeclass have premultiplied data. If either source or destination Rasters are not premultiplied however appropriate conversions are performed before and after the compositing operation.The alpha resulting from the compositing operation is stored in the destination if the destination has an alpha channel. Otherwise the resulting color is divided by the resulting alpha before being stored in the destination and the alpha is discarded. If the alpha value is 0.0 the color values are set to 0.0. @see Composite @see CompositeContext @version 10 Feb 1997
Creates anAlphaCompositeobject with the specified rule. @param rule the compositing rule @throws IllegalArgumentException ifruleis not one of the following: #CLEAR #SRC #DST #SRC_OVER #DST_OVER #SRC_IN #DST_IN #SRC_OUTor#DST_OUT #SRC_ATOP #DST_ATOP or #XOR
TheBasicStrokeclass defines a basic set of rendering attributes for the outlines of graphics primitives which are rendered with a Graphics2D object that has its Stroke attribute set to thisBasicStroke. The rendering attributes defined byBasicStrokedescribe the shape of the mark made by a pen drawn along the outline of a Shape and the decorations applied at the ends and joins of path segments of theShape. These rendering attributes include:All attributes that specify measurements and distances controlling the shape of the returned outline are measured in the same coordinate system as the original unstroked
- width
- The pen width measured perpendicularly to the pen trajectory.
- end caps
- The decoration applied to the ends of unclosed subpaths and dash segments. Subpaths that start and end on the same point are still considered unclosed if they do not have a CLOSE segment. See SEG_CLOSE for more information on the CLOSE segment. The three different decorations are: #CAP_BUTT #CAP_ROUND and #CAP_SQUARE
- line joins
- The decoration applied at the intersection of two path segments and at the intersection of the endpoints of a subpath that is closed using SEG_CLOSE The three different decorations are: #JOIN_BEVEL #JOIN_MITER and #JOIN_ROUND
- miter limit
- The limit to trim a line join that has a JOIN_MITER decoration. A line join is trimmed when the ratio of miter length to stroke width is greater than the miterlimit value. The miter length is the diagonal length of the miter which is the distance between the inside corner and the outside corner of the intersection. The smaller the angle formed by two line segments the longer the miter length and the sharper the angle of intersection. The default miterlimit value of 10.0f causes all angles less than 11 degrees to be trimmed. Trimming miters converts the decoration of the line join to bevel.
- dash attributes
- The definition of how to make a dash pattern by alternating between opaque and transparent sections.
Shapeargument. When aGraphics2Dobject uses aStrokeobject to redefine a path during the execution of one of itsdrawmethods the geometry is supplied in its original form before theGraphics2Dtransform attribute is applied. Therefore attributes such as the pen width are interpreted in the user space coordinate system of theGraphics2Dobject and are subject to the scaling and shearing effects of the user-space-to-device-space transform in that particularGraphics2D. For example the width of a rendered shape's outline is determined not only by the width attribute of thisBasicStrokebut also by the transform attribute of theGraphics2Dobject. Consider this code:// sets the Graphics2D object's Tranform attribute g2d.scale(10 10); // sets the Graphics2D object's Stroke attribute g2d.setStroke(new BasicStroke(1.5f));Assuming there are no other scaling transforms added to theGraphics2Dobject the resulting line will be approximately 15 pixels wide. As the example code demonstrates a floating-point line offers better precision especially when large transforms are used with aGraphics2Dobject. When a line is diagonal the exact width depends on how the rendering pipeline chooses which pixels to fill as it traces the theoretical widened outline. The choice of which pixels to turn on is affected by the antialiasing attribute because the antialiasing rendering pipeline can choose to color partially-covered pixels.For more information on the user space coordinate system and the rendering process see the
Graphics2Dclass comments. @see Graphics2D @version 1.370212/0903/01 @author Jim Graham
A border layout lays out a container arranging and resizing its components to fit in five regions: north south east west and center. Each region may contain no more than one component and is identified by a corresponding constant:Class BorderLayout, String AFTER_LAST_LINENORTHSOUTHEASTWESTandCENTER. When adding a component to a container with a border layout use one of these five constants for example:Panel p = new Panel(); p.setLayout(new BorderLayout()); p.add(new Button("Okay") BorderLayout.SOUTH);As a convenienceBorderLayoutinterprets the absence of a string specification the same as the constantCENTER:Panel p2 = new Panel(); p2.setLayout(new BorderLayout()); p2.add(new TextArea()); // Same as p.add(new TextArea() BorderLayout.CENTER);In addition
BorderLayoutsupportsfourthe relative positioning constantsBEFORE_FIRSTPAGE_LINESTARTAFTERPAGE_LAST_LINEENDandBEFORE_LINE_BEGINSSTART. In a container whoseAFTER_LINE_ENDSENDComponentOrientationis set toComponentOrientation.LEFT_TO_RIGHTthese constants map toNORTHSOUTHWESTandEASTrespectively.
MixingFor compatibility with previous releasesBorderLayoutalso includes thetwo typesrelative positioningofconstantsBEFORE_FIRST_LINEAFTER_LAST_LINEBEFORE_LINE_BEGINSandAFTER_LINE_ENDS. These are equivalent toPAGE_STARTPAGE_ENDLINE_STARTandLINE_ENDrespectively. For consistency with the relative positioning constants used by other components the latter constants are preferred.Mixing
both absolute and relative positioning constants can lead to unpredicable results. If you use both types the relative constants will take precedence. For example if you add components using both theNORTHandconstants in a container whose orientation isBEFORE_FIRSTPAGE_LINESTARTLEFT_TO_RIGHTonly thewill be layed out.BEFORE_FIRSTPAGE_LINESTARTNOTE: Currently (in the Java 2 platform v1.2)
BorderLayoutdoes not support vertical orientations. TheisVerticalsetting on the container'sComponentOrientationis not respected.The components are laid out according to their preferred sizes and the constraints of the container's size. The
NORTHandSOUTHcomponents may be stretched horizontally; theEASTandWESTcomponents may be stretched vertically; theCENTERcomponent may stretch both horizontally and vertically to fill any space left over.Here is an example of five buttons in an applet laid out using the
BorderLayoutlayout manager:
![]()
The code for this applet is as follows:
import java.awt.*; import java.applet.Applet; public class buttonDir extends Applet { public void init() { setLayout(new BorderLayout()); add(new Button("North") BorderLayout.NORTH); add(new Button("South") BorderLayout.SOUTH); add(new Button("East") BorderLayout.EAST); add(new Button("West") BorderLayout.WEST); add(new Button("Center") BorderLayout.CENTER); } }
@version 1.
45 0249 12/0203/0001 @author Arthur van Hoff @see java.awt.Container#add(String Component) @see java.awt.ComponentOrientation @since JDK1.0
Class BorderLayout, String AFTER_LINE_ENDSThe componentSynonym forcomes after thePAGE_END.last line of theExists for compatibility withlayout'spreviouscontentversions.For Western top-to-bottom left-to-rightPAGE_ENDorientations thisisequivalent to SOUTHpreferred. @seejava.awt.Component#getComponentOrientationPAGE_END @since 1.2
Class BorderLayout, String BEFORE_FIRST_LINETheSynonymcomponent goes at the end of the line directionforthe layoutLINE_END.For WesternExiststop-to-bottomforleft-to-rightcompatibilityorientations thiswith previousisversions.equivalentLINE_ENDto EASTis preferred. @seejava.awt.Component#getComponentOrientationLINE_END @since 1.2
Class BorderLayout, String BEFORE_LINE_BEGINSThe componentSynonym forcomes before thePAGE_START.first line of theExists for compatibility withlayout'spreviouscontentversions.For Western top-to-bottom left-to-rightPAGE_STARTorientations thisisequivalent to NORTHpreferred. @seejava.awt.Component#getComponentOrientationPAGE_START @since 1.2
TheSynonymcomponent goes at the beginning of the line directionforthe layoutLINE_START.For WesternExiststop-to-bottomforleft-to-rightcompatibilityorientations thiswith previousisversions.equivalentLINE_STARTto WESTis preferred. @seejava.awt.Component#getComponentOrientationLINE_START @since 1.2
This class creates a labeled button. The application can cause some action to happen when the button is pushed. This image depicts three views of a "Class Button, constructor Button()Quit" button as it appears under the Solaris operating system:
![]()
The first view shows the button as it appears normally. The second view shows the button when it has input focus. Its outline is darkened to let the user know that it is an active object. The third view shows the button when the user clicks the mouse over the button and thus requests that an action be performed.
The gesture of clicking on a button with the mouse is associated with one instance of
ActionEventwhich is sent out when the mouse is both pressed and released over the button. If an application is interested in knowing when the button has been pressed but not released as a separate gesture it can specializeprocessMouseEventor it can register itself as a listener for mouse events by callingaddMouseListener. Both of these methods are defined byComponentthe abstract superclass of all components.When a button is pressed and released AWT sends an instance of
ActionEventto the button by callingprocessEventon the button. The button'sprocessEventmethod receives all events for the button; it passes an action event along by calling its ownprocessActionEventmethod. The latter method passes the action event on to any action listeners that have registered an interest in action events generated by this button.If an application wants to perform some action based on a button being pressed and released it should implement
ActionListenerand register the new listener to receive events from this button by calling the button'saddActionListenermethod. The application can make use of the button's action command as a messaging protocol. @version 1.58 0368 12/1403/0001 @author Sami Shaio @see java.awt.event.ActionEvent @see java.awt.event.ActionListener @see java.awt.Component#processMouseEvent @see java.awt.Component#addMouseListener @since JDK1.0
Constructs a Button with no label. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadlessClass Button, constructor Button(String)
Constructs a Button with the specified label. @param label A string label for the button. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadlessClass Button, void addActionListener(ActionListener)
Adds the specified action listener to receive action events from this button. Action events occur when a user presses or releases the mouse over this button. If l is null no exception is thrown and no action is performed. @param l the action listener @seeClass Button, AccessibleContext getAccessibleContext()java.awt.event.ActionListener#removeActionListener @see #getActionListeners @see java.awt.Button#removeActionListenerevent.ActionListener @since JDK1.1
Gets theClass Button, EventListener[] getListeners(Class)AccessibleContextassociated with thisButton. For buttons theAccessibleContexttakes the form of anAccessibleAWTButton. A newAccessibleAWTButtoninstance is created if necessary. @return anAccessibleAWTButtonthat serves as theAccessibleContextof thisButton@beaninfo expert: true description: The AccessibleContext associated with this Button.
Class Button, String paramString()ReturnReturns an array of all thelistenersobjectsthat were addedcurrently registered astoFooListenersthe Buttonupon thiswithButton.addXXXListener()FooListenerswhere XXX isare registered using thenameaddFooListenerofmethod. You can specify thelistenerTypeargument.For example to get all ofwith a class literal such astheFooListener.class.ActionListener(s)Forforexampletheyou can querygivenaButtonbonefor itswouldactionwritelisteners with the following code:If no suchActionListener[] als = (ActionListener[])(b.getListeners(ActionListener.class));listenerlisteners existlist exists thenthis method returns an empty arrayis returned. @param listenerTypeTypethe type of listeners requested; this parameter should specify an interface that descends fromjava.util.EventListener@returnallan array oftheall objects registered asFooListeners on this button or an empty array if no such listenersof the specifiedhave been addedtype@exceptionsupported byClassCastException ifthislistenerTypebuttondoesn't specify a class or interface that implementsjava.util.EventListener@see #getActionListeners @since 1.3
ReturnsClass Button, void processActionEvent(ActionEvent)the parametera string representing the state of thisbuttonButton. Thisstringmethod isusefulintended to be used only for debugging purposes and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull. @return the parameter string of this button.
Processes action events occurring on this button by dispatching them to any registeredClass Button, void processEvent(AWTEvent)ActionListenerobjects.This method is not called unless action events are enabled for this button. Action events are enabled when one of the following occurs:
- An
ActionListenerobject is registered viaaddActionListener.- Action events are enabled via
enableEvents.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the action event.@see java.awt.event.ActionListener @see java.awt.Button#addActionListener @see java.awt.Component#enableEvents @since JDK1.1
Processes events on this button. If an event is an instance ofClass Button, void removeActionListener(ActionListener)ActionEventthis method invokes theprocessActionEventmethod. Otherwise it invokesprocessEventon the superclass.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the event.@see java.awt.event.ActionEvent @see java.awt.Button#processActionEvent @since JDK1.1
Removes the specified action listener so that it no longer receives action events from this button. Action events occur when a user presses or releases the mouse over this button. If l is null no exception is thrown and no action is performed. @param l the action listener @seejava.awt.event.ActionListener#addActionListener @see #getActionListeners @see java.awt.Button#addActionListenerevent.ActionListener @since JDK1.1
AClass Canvas, void paint(Graphics)Canvascomponent represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user.An application must subclass the
Canvasclass in order to get useful functionality such as creating a custom component. Thepaintmethod must be overridden in order to perform custom graphics on the canvas. @version 1.28 0332 12/1503/0001 @author Sami Shaio @since JDK1.0
Class Canvas, void update(Graphics)ThisPaintsmethod is called to repaintthis canvas.Most applications that subclass
Canvasshould override this method in order to perform some useful operation. The paint method provided by Canvas redrawsthis(typicallycanvas'scustomrectangle inpainting of thebackground colorcanvas).Thegraphics context's origin (0default0)operation isthe top-leftsimplycorner of thisto clear the canvas.ItsApplicationsclipping region is the area of the contextthat override this method need not call super.paint(g). @param g thegraphicsspecified Graphics context.@seejava.awt.#update(Graphics) @see Component#paint(Graphics)
Updates thiscomponentcanvas.
The AWT callsThisthemethodupdateismethodcalled in response to a call torepaint.update or paintYou can assume that theThebackgroundcanvas isnotfirst cleared. The updatemethod ofComponent does the following: Clears this componentby filling it with the background color. Sets the color of the graphics context to bethe foregroundandcolor of thisthen completely redrawncomponent.byCallscalling thiscomponentcanvas'spaintmethodto completely redraw this component. Note:The origin of the graphics context itsapplications that override this method should either call super.update(0 0g)coordinate point is the top-left corner of this component. The clipping regionorofincorporate thegraphicsfunctionalitycontext is thedescribedbounding rectangle of this componentabove into their own code. @param g the specifiedcontext to use forGraphicsupdating.context @seejava.awt.Component#paint(Graphics) @seejava.awt.Component#repaintupdate(Graphics)@since JDK1.0
AClass CardLayout, void removeLayoutComponent(Component)CardLayoutobject is a layout manager for a container. It treats each component in the container as a card. Only one card is visible at a time and the container acts as a stack of cards. The first component added to aCardLayoutobject is the visible component when the container is first displayed.The ordering of cards is determined by the container's own internal ordering of its component objects.
CardLayoutdefines a set of methods that allow an application to flip through these cards sequentially or to show a specified card. TheCardLayouCardLayout#addLayoutComponent method can be used to associate a string identifier with a given card for fast random access. @version 1.30 0635 12/3003/0001 @author Arthur van Hoff @see java.awt.Container @since JDK1.0
Removes the specified component from the layout.If the card was visible on top the next card underneath it is shown.@param comp the component to be removed. @see java.awt.Container#remove(java.awt.Component) @see java.awt.Container#removeAll()
A check box is a graphical component that can be in either an "on" (Class Checkbox, constructor Checkbox()true) or "off" (false) state. Clicking on a check box changes its state from "on" to "off " or from "off" to "on."The following code example creates a set of check boxes in a grid layout:
setLayout(new GridLayout(3 1)); add(new Checkbox("one" null true)); add(new Checkbox("two")); add(new Checkbox("three"));
This image depicts the check boxes and grid layout created by this code example:
![]()
The button labeled
oneis in the "on" state and the other two are in the "off" state. In this example which uses theGridLayoutclass the states of the three check boxes are set independently.Alternatively several check boxes can be grouped together under the control of a single object using the
CheckboxGroupclass. In a check box group at most one button can be in the "on" state at any given time. Clicking on a check box to turn it on forces any other check box in the same group that is on into the "off" state. @version 1.59 0372 12/1403/0001 @author Sami Shaio @see java.awt.GridLayout @see java.awt.CheckboxGroup @since JDK1.0
Creates a check box with no label. The state of this check box is set to "off " and it is not part of any check box group. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadlessClass Checkbox, constructor Checkbox(String)
Creates a check box with the specified label. The state of this check box is set to "off " and it is not part of any check box group. @param label a string label for this check box orClass Checkbox, constructor Checkbox(String, CheckboxGroup, boolean)nullfor no label. @exception HeadlessException ifGraphicsEnvironment.isHeadlessreturnstrue@see java.awt.GraphicsEnvironment#isHeadless
Class Checkbox, constructor Checkbox(String, boolean)ConstructsCreates aCheckboxcheck box with the specified labelset toin the specifiedstatecheck box group andinset to the specifiedcheck box groupstate. @param label a string label for this check box ornullfor no label. @param group a check box group for this check box ornullfor no group. @param state the initial state of this check box. @exception HeadlessException ifGraphicsEnvironment.isHeadlessreturnstrue@see java.awt.GraphicsEnvironment#isHeadless @since JDK1.1
Creates a check box with the specified label and sets the specified state. This check box is not part of any check box group. @param label a string label for this check box orClass Checkbox, constructor Checkbox(String, boolean, CheckboxGroup)nullfor no label.@param state the initial state of this check box @exception HeadlessException ifGraphicsEnvironment.isHeadlessreturnstrue@see java.awt.GraphicsEnvironment#isHeadless
Class Checkbox, void addItemListener(ItemListener)CreatesConstructs acheck boxCheckbox with the specified labelinset to the specifiedcheck box groupstate andset toin the specifiedstatecheck box group. @param label a string label for this check box ornullfor no label. @param state the initial state of this check box. @param group a check box group for this check box ornullfor no group. @exception HeadlessException ifGraphicsEnvironment.isHeadlessreturnstrue@see java.awt.GraphicsEnvironment#isHeadless @since JDK1.1
Adds the specified item listener to receive item events from this check box. Item events are sent to listeners in response to user input but not in response to calls to setState(). If l is null no exception is thrown and no action is performed. @param l the item listener @seeClass Checkbox, CheckboxGroup getCheckboxGroup()java.awt.event.ItemEvent#removeItemListener @see #getItemListeners @see #setState @see java.awt.event.ItemListenerItemEvent @see java.awt.Checkbox#removeItemListenerevent.ItemListener @since JDK1.1
Determines this check box's group. @return this check box's group orClass Checkbox, String getLabel()nullif the check box is not part of a check box group. @seejava.awt.Checkbox#setCheckboxGroup
Gets the label of this check box. @return the label of this check box orClass Checkbox, EventListener[] getListeners(Class)nullif this check box has no label. @seejava.awt.Checkbox#setLabel
Class Checkbox, boolean getState()ReturnReturns an array of all thelistenersobjectsthat were addedcurrently registered astoFooListenersthe Checkboxupon thiswithCheckbox.addXXXListener()FooListenerswhere XXX isare registered using thenameaddFooListenerofmethod. You can specify thelistenerTypeargument.For example to get all ofwith a class literal such astheFooListener.class.ItemListener(s)Forforexampletheyou can querygivenaCheckboxconefor itswoulditemwritelisteners with the following code:If no suchItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));listenerlisteners existlist exists thenthis method returns an empty arrayis returned. @param listenerTypeTypethe type of listeners requested; this parameter should specify an interface that descends fromjava.util.EventListener@returnallan array oftheall objects registered asFooListeners on this checkbox or an empty array if no such listenersof the specifiedhave been addedtype@exceptionsupported byClassCastException ifthislistenerTypecheckboxdoesn't specify a class or interface that implementsjava.util.EventListener@see #getItemListeners @since 1.3
Determines whether this check box is in the "on" or "off" state. The boolean valueClass Checkbox, String paramString()trueindicates the "on" state andfalseindicates the "off" state. @return the state of this check box as a boolean value.@seejava.awt.Checkbox#setState
ReturnsClass Checkbox, void processEvent(AWTEvent)the parametera string representing the state of thischeck boxCheckbox. Thisstringmethod isusefulintended to be used only for debugging purposes and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull. @return the parameter string of this check box.
Processes events on this check box. If the event is an instance ofClass Checkbox, void processItemEvent(ItemEvent)ItemEventthis method invokes theprocessItemEventmethod. Otherwise it calls its superclass'sprocessEventmethod.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the event.@see java.awt.event.ItemEvent @seejava.awt.Checkbox#processItemEvent @since JDK1.1
Processes item events occurring on this check box by dispatching them to any registeredClass Checkbox, void removeItemListener(ItemListener)ItemListenerobjects.This method is not called unless item events are enabled for this component. Item events are enabled when one of the following occurs:
- An
ItemListenerobject is registered viaaddItemListener.- Item events are enabled via
enableEvents.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the item event.@see java.awt.event.ItemEvent @see java.awt.event.ItemListener @seejava.awt.Checkbox#addItemListener @see java.awt.Component#enableEvents @since JDK1.1
Removes the specified item listener so that the item listener no longer receives item events from this check box. If l is null no exception is thrown and no action is performed. @param l the item listener @seeClass Checkbox, void setCheckboxGroup(CheckboxGroup)java.awt.event.ItemEvent#addItemListener @see #getItemListeners @see java.awt.event.ItemListenerItemEvent @see java.awt.Checkbox#addItemListenerevent.ItemListener @since JDK1.1
Sets this check box's group to be the specified check box group. If this check box is already in a different check box group it is first taken out of that group. @param g the new check box group orClass Checkbox, void setLabel(String)nullto remove this check box from any check box group. @seejava.awt.Checkbox#getCheckboxGroup
Sets this check box's label to be the string argument. @param label a string to set as the new label orClass Checkbox, void setState(boolean)nullfor no label. @seejava.awt.Checkbox#getLabel
Sets the state of this check box to the specified state. The boolean valuetrueindicates the "on" state andfalseindicates the "off" state.Note that this method should be primarily used to initialize the state of the checkbox. Programmatically setting the state of the checkbox will not trigger an
ItemEvent. The only way to trigger anItemEventis by user interaction. @param state the boolean state of the check box.@seejava.awt.Checkbox#getState
TheCheckboxGroupclass is used to group together a set ofCheckboxbuttons.Exactly one check box button in a
CheckboxGroupcan be in the "on" state at any given time. Pushing any button sets its state to "on" and forces any other button that is in the "on" state into the "off" state.The following code example produces a new check box group with three check boxes:
setLayout(new GridLayout(3 1)); CheckboxGroup cbg = new CheckboxGroup(); add(new Checkbox("one" cbg true)); add(new Checkbox("two" cbg false)); add(new Checkbox("three" cbg false));
This image depicts the check box group created by this example:
![]()
@version 1.
29 0230 12/0203/0001 @author Sami Shaio @see java.awt.Checkbox @since JDK1.0
This class represents a check box that can be included in a menu.Class CheckboxMenuItem, constructor CheckboxMenuItem()ClickingSelectingonthe check box in the menu changes its state from "on" to "off" or from "off" to "on."The following picture depicts a menu which contains an instance of
CheckBoxMenuItem:
![]()
The item labeled
Checkshows a check box menu item in its "off" state.When a check box menu item is selected AWT sends an item event to the item. Since the event is an instance of
ItemEventtheprocessEventmethod examines the event and passes it along toprocessItemEvent. The latter method redirects the event to anyItemListenerobjects that have registered an interest in item events generated by this menu item. @version 1.49 0362 12/1403/0001 @author Sami Shaio @see java.awt.event.ItemEvent @see java.awt.event.ItemListener @since JDK1.0
Create a check box menu item with an empty label. The item's state is initially set to "off." @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless @since JDK1.1Class CheckboxMenuItem, constructor CheckboxMenuItem(String)
Create a check box menu item with the specified label. The item's state is initially set to "off." @param label a string label for the check box menu item or null for an unlabeled menu item. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class CheckboxMenuItem, constructor CheckboxMenuItem(String, boolean)Create a check box menu item with the specified label and state. @param label a string label for the check box menu item orClass CheckboxMenuItem, void addItemListener(ItemListener)nullfor an unlabeled menu item. @param state the initial state of the menu item wheretrueindicates "on" andfalseindicates "off." @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless @since JDK1.1
Adds the specified item listener to receive item events from this check box menu item. Item events are sent in response to user actions but not in response to calls to setState(). If l is null no exception is thrown and no action is performed. @param l the item listener @seeClass CheckboxMenuItem, EventListener[] getListeners(Class)java.awt.event.ItemEvent#removeItemListener @see #getItemListeners @see #setState @see java.awt.event.ItemListenerItemEvent @see java.awt.Choice#removeItemListenerevent.ItemListener @since JDK1.1
Class CheckboxMenuItem, boolean getState()ReturnReturns an array of all thelistenersobjectsthat were addedcurrently registered astoFooListenersthe CheckboxMenuItemupon thiswithCheckboxMenuItem.addXXXListener()FooListenerswhere XXX isare registered using thenameaddFooListenerofmethod. You can specify thelistenerTypeargument.For example to get all ofwith a class literal such astheFooListener.class.ItemListener(s)Forforexampletheyou cangivenquery aCheckboxMenuItemconefor its item listeners withwouldthe followingwritecode:If no suchItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));listenerlisteners existlist exists thenthis method returns an empty arrayis returned. @param listenerTypeTypethe type of listeners requested; this parameter should specify an interface that descends fromjava.util.EventListener@returnallan array oftheall objects registered asFooListeners on this checkbox menuitem or an empty array if no such listenersof the specifiedhave been addedtype@exceptionsupported byClassCastException ifthislistenerTypecheckboxdoesn'tmenuspecifyitema class or interface that implementsjava.util.EventListener@see #getItemListeners @since 1.3
Determines whether the state of this check box menu item is "on" or "off." @return the state of this check box menu item whereClass CheckboxMenuItem, String paramString()trueindicates "on" andfalseindicates "off." @seejava.awt.CheckboxMenuItem#setState
ReturnsClass CheckboxMenuItem, void processEvent(AWTEvent)the parametera string representing the state of thischeck box menu itemCheckBoxMenuItem. Thisstringmethod isusefulintended to be used only for debugging purposes and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull. @return the parameter string of this check box menu item.
Processes events on this check box menu item. If the event is an instance ofClass CheckboxMenuItem, void processItemEvent(ItemEvent)ItemEventthis method invokes theprocessItemEventmethod. If the event is not an item event it invokesprocessEventon the superclass.Check box menu items currently support only item events.
Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the event @see java.awt.event.ItemEvent @seejava.awt.CheckboxMenuItem#processItemEvent @since JDK1.1
Processes item events occurring on this check box menu item by dispatching them to any registeredClass CheckboxMenuItem, void removeItemListener(ItemListener)ItemListenerobjects.This method is not called unless item events are enabled for this menu item. Item events are enabled when one of the following occurs:
- An
ItemListenerobject is registered viaaddItemListener.- Item events are enabled via
enableEvents.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the item event.@see java.awt.event.ItemEvent @see java.awt.event.ItemListener @seejava.awt.CheckboxMenuItem#addItemListener @see java.awt.MenuItem#enableEvents @since JDK1.1
Removes the specified item listener so that it no longer receives item events from this check box menu item. If l is null no exception is thrown and no action is performed. @param l the item listener @seeClass CheckboxMenuItem, void setState(boolean)java.awt.event.ItemEvent#addItemListener @see #getItemListeners @see java.awt.event.ItemListenerItemEvent @see java.awt.Choice#addItemListenerevent.ItemListener @since JDK1.1
Sets this check box menu item to the specifed state. The boolean valuetrueindicates "on" whilefalseindicates "off."@paramNote
bthat this method should be primarily used to initialize thebooleanstate of the check box menu item. Programmatically setting the state ofthisthe check box menu item will not trigger anItemEvent. The only way to trigger anItemEventis by user interaction. @param btrueif the check box menu item is on otherwisefalse@seejava.awt.CheckboxMenuItem#getState
TheClass Choice, constructor Choice()Choiceclass presents a pop-up menu of choices. The current choice is displayed as the title of the menu.The following code example produces a pop-up menu:
Choice ColorChooser = new Choice(); ColorChooser.add("Green"); ColorChooser.add("Red"); ColorChooser.add("Blue");
After this choice menu has been added to a panel it appears as follows in its normal state:
![]()
In the picture
"Green"is the current choice. Pushing the mouse button down on the object causes a menu to appear with the current choice highlighted.Some native platforms do not support arbitrary resizing of
Choicecomponents and the behavior ofsetSize()/getSize()is bound by such limitations. Native GUIChoicecomponents' size are often bound by such attributes as font size and length of items contained within theChoice.@version 1.
64 0378 12/1403/0001 @author Sami Shaio @author Arthur van Hoff @since JDK1.0
Creates a new choice menu. The menu initially has no items in it.Class Choice, void add(String)By default the first item added to the choice menu becomes the selected item until a different selection is made by the user by calling one of the
selectmethods. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.ChoiceGraphicsEnvironment#isHeadless @see #select(int) @seejava.awt.Choice#select(java.lang.String)
Adds an item to thisClass Choice, void addItem(String)Choicemenu. @param item the item to be added @exception NullPointerException if the item's value isnull.@since JDK1.1
Obsolete as of Java 2 platform v1.1. Please use theClass Choice, void addItemListener(ItemListener)addmethod instead.Adds an item to this
Choicemenu. @param item the item to be added @exception NullPointerExceptionIfif the item's value is equal tonull.
Adds the specified item listener to receive item events from thisClass Choice, void addNotify()Choicemenu. Item events are sent in response to user input but not in response to calls toselect. If l isnullno exception is thrown and no action is performed. @param l the item listener.@seejava.awt.event.ItemEvent#removeItemListener @see #getItemListeners @see #select @see java.awt.event.ItemListenerItemEvent @see java.awt.Choice#removeItemListenerevent.ItemListener @since JDK1.1
Creates theClass Choice, AccessibleContext getAccessibleContext()Choice's peer. This peer allows us to change the look of theChoicewithout changing its functionality. @see java.awt.Toolkit#createChoice(java.awt.Choice) @see java.awt.Component#getToolkit()
Gets theClass Choice, String getItem(int)AccessibleContextassociated with thisChoice. ForChoicecomponents theAccessibleContexttakes the form of anAccessibleAWTChoice. A newAccessibleAWTChoiceinstance is created if necessary. @return anAccessibleAWTChoicethat serves as theAccessibleContextof thisChoice
Gets the string at the specified index in thisClass Choice, int getItemCount()Choicemenu. @param index the index at which to begin.@seejava.awt.Choice#getItemCount
Returns the number of items in thisClass Choice, EventListener[] getListeners(Class)Choicemenu. @seereturnjava.awt.the number of items in thisChoice menu @see #getItem @since JDK1.1
Class Choice, String getSelectedItem()ReturnReturns an array of all thelistenersobjectsthat were addedcurrently registered astoFooListenersthe Choiceupon thiswithChoice.addXXXListener()FooListenerswhere XXX isare registered using thenameaddFooListenerofmethod. You can specify thelistenerTypeargument.For example to get all ofwith a class literal such astheFooListener.class.ItemListener(s)Forforexampletheyou can querygivenaChoiceconefor itswoulditemwritelisteners with the following code:If no suchItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));listenerlisteners existlist exists thenthis method returns an empty arrayis returned. @param listenerTypeTypethe type of listeners requested; this parameter should specify an interface that descends fromjava.util.EventListener@returnallan array oftheall objects registered asFooListeners on this choice or an empty array if no such listenersof the specifiedhave been addedtype@exceptionsupported byClassCastException ifthislistenerTypechoicedoesn't specify a class or interface that implementsjava.util.EventListener@see #getItemListeners @since 1.3
Gets a representation of the current choice as a string. @return a string representation of the currently selected item in this choice menuClass Choice, Object[] getSelectedObjects().@seejava.awt.Choice#getSelectedIndex
Returns an array (length 1) containing the currently selected item. If this choice has no items returns null. @see ItemSelectable
Class Choice, void insert(String, int)Inserts the item into this choice at the specified position. Existing items at an index greater than or equal toClass Choice, String paramString()indexare shifted up by one to accommodate the new item. Ifindexis greater than or equal to the number of items in this choiceitemis added to the end of this choice.If the item is the first one being added to the choice then the item becomes selected. Otherwise if the selected item was one of the items shifted the first item in the choice becomes the selected item. If the selected item was no among those shifted it remains the selected item.
@param item the non-nullitem to be inserted @param index the position at which the item should be inserted @exception IllegalArgumentException if index is less than 0.
ReturnsClass Choice, void processEvent(AWTEvent)the parametera string representing the state of thischoiceChoicemenu. Thisstringmethod isusefulintended to be used only for debugging purposes and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull. @return the parameter string of thisChoicemenu.
Processes events on this choice. If the event is an instance ofClass Choice, void processItemEvent(ItemEvent)ItemEventit invokes theprocessItemEventmethod. Otherwise it calls its superclass'sprocessEventmethod.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the event.@see java.awt.event.ItemEvent @seejava.awt.Choice#processItemEvent @since JDK1.1
Processes item events occurring on thisClass Choice, void remove(String)Choicemenu by dispatching them to any registeredItemListenerobjects.This method is not called unless item events are enabled for this component. Item events are enabled when one of the following occurs:
- An
ItemListenerobject is registered viaaddItemListener.- Item events are enabled via
enableEvents.Note that if the event parameter is
nullthe behavior is unspecified and may result in an exception. @param e the item event.@see java.awt.event.ItemEvent @see java.awt.event.ItemListener @seejava.awt.Choice#addItemListener @see java.awt.Component#enableEvents @since JDK1.1
Class Choice, void remove(int)RemoveRemoves the first occurrence ofitemfrom theChoicemenu. If the item being removed is the currently selected item then the first item in the choice becomes the selected item. Otherwise the currently selected item remains selected (and the selected index is updated accordingly). @param item the item to remove from thisChoicemenu.@exception IllegalArgumentException if the item doesn't exist in the choice menu.@since JDK1.1
Removes an item from the choice menu at the specified position. If the item being removed is the currently selected item then the first item in the choice becomes the selected item. Otherwise the currently selected item remains selected (and the selected index is @param position the position of the itemClass Choice, void removeAll().@throws IndexOutOfBoundsException if the specified position is out of bounds @since JDK1.1
Removes all items from the choice menu. @seeClass Choice, void removeItemListener(ItemListener)java.awt.Choice#remove @since JDK1.1
Removes the specified item listener so that it no longer receives item events from thisClass Choice, void select(String)Choicemenu. If l isnullno exception is thrown and no action is performed. @param l the item listener.@seejava.awt.event.ItemEvent#addItemListener @see #getItemListeners @see java.awt.event.ItemListenerItemEvent @see java.awt.Choice#addItemListenerevent.ItemListener @since JDK1.1
Sets the selected item in thisClass Choice, void select(int)Choicemenu to be the item whose name is equal to the specified string. If more than one item matches (is equal to) the specified string the one with the smallest index is selected.Note that this method should be primarily used to initially select an item in this component. Programmatically calling this method will not trigger an
ItemEvent. The only way to trigger anItemEventis by user interaction. @param str the specified string @seejava.awt.Choice#getSelectedItem @seejava.awt.Choice#getSelectedIndex
Sets the selected item in thisChoicemenu to be the item at the specified position.Note that this method should be primarily used to initially select an item in this component. Programmatically calling this method will not trigger an
ItemEvent. The only way to trigger anItemEventis by user interaction. @param pos the positon of the selected item.@exception IllegalArgumentException if the specified position isinvalid.greater than the number of items or less than zero @seejava.awt.Choice#getSelectedItem @seejava.awt.Choice#getSelectedIndex
A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user. Examples of components are the buttons checkboxes and scrollbars of a typical graphical user interface.The
Componentclass is the abstract superclass of the nonmenu-related Abstract Window Toolkit components. ClassComponentcan also be extended directly to create a lightweight component. A lightweight component is a component that is not associated with a native opaque window.
Serialization
It is important to note that only AWT listeners which conform to theSerializableprotocol will be saved when the object is stored. If an AWT object has listeners that aren't marked serializable they will be dropped atwriteObjecttime. Developers will need as always to consider the implications of making an object serializable. One situation to watch out for is this:import java.awt.*; import java.awt.event.*; import java.io.Serializable; class MyApp implements ActionListener Serializable { BigObjectThatShouldNotBeSerializedWithAButton bigOne; Button aButton = new Button(); MyApp() { // Oops now aButton has a listener with a reference // to bigOne aButton.addActionListener(this); } public void actionPerformed(ActionEvent e) { System.out.println("Hello There"); } }In this example serializingaButtonby itself will causeMyAppand everything it refers to to be serialized as well. The problem is that the listener is serializable by coincidence not by design. To separate the decisions aboutMyAppand theActionListenerbeing serializable one can use a nested class as in the following example:import java.awt.*; import java.awt.event.*; import java.io.Serializable; class MyApp java.io.Serializable { BigObjectThatShouldNotBeSerializedWithAButton bigOne; Button aButton = new Button(); class MyActionListener implements ActionListener { public void actionPerformed(ActionEvent e) { System.out.println("Hello There"); } } MyApp() { aButton.addActionListener(new MyActionListener()); } }@version 1.265 02330 12/2803/0001 @author Arthur van Hoff @author Sami Shaio
Checks whether the specified point is within this object's bounds where the point's x and y coordinates are defined to be relative to the coordinate system of the object. @param p theClass Component.AccessibleAWTComponent, Accessible getAccessibleAt(Point)Pointrelative to the coordinate system of the object @return true if object containsPoint; otherwise false
Returns theClass Component.AccessibleAWTComponent, Accessible getAccessibleChild(int)Accessiblechild if one exists contained at the local coordinatePoint. Otherwise returnsnull. @param pThethe point defining the top-left corner of theAccessiblegiven in the coordinate space of the object's parent.@return theAccessibleif it exists at the specified location; elsenull
Class Component.AccessibleAWTComponent, int getAccessibleChildrenCount()ReturnReturns the nthAccessiblechild of the object. @param i zero-based index of child @return the nthAccessiblechild of the object
Returns the number of accessible children in the object. If all of the children of this object implementClass Component.AccessibleAWTComponent, AccessibleComponent getAccessibleComponent()Accessiblethanthen this method should return the number of children of this object. @return the number of accessible children in the object.
Class Component.AccessibleAWTComponent, String getAccessibleDescription()GetGets theAccessibleComponentassociated with this object if one exists. Otherwise returnnull. @return the component
Class Component.AccessibleAWTComponent, int getAccessibleIndexInParent()GetGets the accessible description of this object. This should be a concise localized description of what this object is - what is its meaning to the user. If the object has a tooltip the tooltip text may be an appropriate string to return assuming it contains a concise description of the object (instead of just the name of the object - e.g. a "Save" icon on a toolbar that had "save" as the tooltip text shouldn't return the tooltip text as the description but something like "Saves the current text document" instead). @return the localized description of the object -- can benullif this object does not have a description @see javax.accessibility.AccessibleContext#setAccessibleDescription
Class Component.AccessibleAWTComponent, String getAccessibleName()GetGets the index of this object in its accessible parent. @return the index of this object in its parent; or -1 if this object does not have an accessible parent.@see #getAccessibleParent
Class Component.AccessibleAWTComponent, Accessible getAccessibleParent()GetGets the accessible name of this object. This should almost never returnjava.awt.Component.getName()as that generally isn't a localized name and doesn't have meaning for the user. If the object is fundamentally a text object (e.g. a menu item) the accessible name should be the text of the object (e.g. "save"). If the object has a tooltip the tooltip text may also be an appropriate String to return. @return the localized name of the object -- can benullif this object does not have a name @see javax.accessibility.AccessibleContext#setAccessibleName
Class Component.AccessibleAWTComponent, AccessibleRole getAccessibleRole()GetGets theAccessibleparent of this object. If the parent of this object implementsAccessiblethis method should simply returngetParent. @return the()Accessibleparent of this object -- can benullif this object does not have anAccessibleparent
Class Component.AccessibleAWTComponent, AccessibleStateSet getAccessibleStateSet()GetGets the role of this object. @return an instance ofAccessibleRoledescribing the role of the object @see javax.accessibility.AccessibleRole
Class Component.AccessibleAWTComponent, Color getBackground()GetGets the state of this object. @return an instance ofAccessibleStateSetcontaining the current state set of the object @see javax.accessibility.AccessibleState
Class Component.AccessibleAWTComponent, Rectangle getBounds()GetGets the background color of this object. @return the background color if supported of the object; otherwisenull
Gets the bounds of this object in the form of a Rectangle object. The bounds specify this object's width height and location relative to its parent. @returnClass Component.AccessibleAWTComponent, Cursor getCursor()Aa rectangle indicating this component's bounds;nullif this object is not on the screen.
Class Component.AccessibleAWTComponent, Font getFont()GetGets theCursorof this object. @return theCursorif supported of the object; otherwisenull
GetGets theFontof this object. @retur