Uses of Class
java.awt.Component
-
Packages that use Component Package Description java.awt Contains all of the classes for creating user interfaces and for painting graphics and images.java.awt.event Provides interfaces and classes for dealing with different types of events fired by AWT components. -
-
Uses of Component in java.awt
Subclasses of Component in java.awt Modifier and Type Class and Description classButtonThis class creates a labeled button.classCanvasACanvascomponent 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.classCheckboxA check box is a graphical component that can be in either an "on" (true) or "off" (false) state.classChoiceTheChoiceclass presents a pop-up menu of choices.classContainerA generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.classDialogA Dialog is a top-level window with a title and a border that is typically used to take some form of input from the user.classFileDialogTheFileDialogclass displays a dialog window from which the user can select a file.classFrameAFrameis a top-level window with a title and a border.classLabelALabelobject is a component for placing text in a container.classListTheListcomponent presents the user with a scrolling list of text items.classPanelPanelis the simplest container class.classScrollbarTheScrollbarclass embodies a scroll bar, a familiar user-interface object.classScrollPaneA container class which implements automatic horizontal and/or vertical scrolling for a single child component.classTextAreaATextAreaobject is a multi-line region that displays text.classTextComponentTheTextComponentclass is the superclass of any component that allows the editing of some text.classTextFieldATextFieldobject is a text component that allows for the editing of a single line of text.classWindowAWindowobject is a top-level window with no borders and no menubar.Fields in java.awt with type parameters of type Component Modifier and Type Field and Description protected java.util.Hashtable<Component,GridBagConstraints>GridBagLayout. comptableThis hashtable maintains the association between a component and its gridbag constraints.Methods in java.awt that return Component Modifier and Type Method and Description ComponentContainer. add(Component comp)Appends the specified component to the end of this container.ComponentContainer. add(Component comp, int index)Adds the specified component to this container at the given position.ComponentContainer. add(java.lang.String name, Component comp)Adds the specified component to this container.ComponentContainer. findComponentAt(int x, int y)Locates the visible child component that contains the specified position.ComponentContainer. findComponentAt(Point p)Locates the visible child component that contains the specified point.ComponentContainer. getComponent(int n)Gets the nth component in this container.abstract ComponentFocusTraversalPolicy. getComponentAfter(Container aContainer, Component aComponent)Returns the Component that should receive the focus after aComponent.ComponentContainerOrderFocusTraversalPolicy. getComponentAfter(Container aContainer, Component aComponent)Returns the Component that should receive the focus after aComponent.ComponentContainer. getComponentAt(int x, int y)Locates the component that contains the x,y position.ComponentComponent. getComponentAt(int x, int y)Determines if this component or one of its immediate subcomponents contains the (x, y) location, and if so, returns the containing component.ComponentContainer. getComponentAt(Point p)Gets the component that contains the specified point.ComponentComponent. getComponentAt(Point p)Returns the component or subcomponent that contains the specified point.abstract ComponentFocusTraversalPolicy. getComponentBefore(Container aContainer, Component aComponent)Returns the Component that should receive the focus before aComponent.ComponentContainerOrderFocusTraversalPolicy. getComponentBefore(Container aContainer, Component aComponent)Returns the Component that should receive the focus before aComponent.Component[]Container. getComponents()Gets all the components in this container.abstract ComponentFocusTraversalPolicy. getDefaultComponent(Container aContainer)Returns the default Component to focus.ComponentContainerOrderFocusTraversalPolicy. getDefaultComponent(Container aContainer)Returns the default Component to focus.abstract ComponentFocusTraversalPolicy. getFirstComponent(Container aContainer)Returns the first Component in the traversal cycle.ComponentContainerOrderFocusTraversalPolicy. getFirstComponent(Container aContainer)Returns the first Component in the traversal cycle.ComponentWindow. getFocusOwner()Returns the child Component of this Window that has focus if this Window is focused; returns null otherwise.ComponentKeyboardFocusManager. getFocusOwner()Returns the focus owner, if the focus owner is in the same context as the calling thread.protected ComponentKeyboardFocusManager. getGlobalFocusOwner()Returns the focus owner, even if the calling thread is in a different context than the focus owner.protected ComponentKeyboardFocusManager. getGlobalPermanentFocusOwner()Returns the permanent focus owner, even if the calling thread is in a different context than the permanent focus owner.ComponentFocusTraversalPolicy. getInitialComponent(Window window)Returns the Component that should receive the focus when a Window is made visible for the first time.abstract ComponentFocusTraversalPolicy. getLastComponent(Container aContainer)Returns the last Component in the traversal cycle.ComponentContainerOrderFocusTraversalPolicy. getLastComponent(Container aContainer)Returns the last Component in the traversal cycle.ComponentBorderLayout. getLayoutComponent(Container target, java.lang.Object constraints)Returns the component that corresponds to the given constraint location based on the targetContainer's component orientation.ComponentBorderLayout. getLayoutComponent(java.lang.Object constraints)Gets the component that was added using the given constraintComponentWindow. getMostRecentFocusOwner()Returns the child Component of this Window that will receive the focus when this Window is focused.ComponentKeyboardFocusManager. getPermanentFocusOwner()Returns the permanent focus owner, if the permanent focus owner is in the same context as the calling thread.ComponentContainer. locate(int x, int y)Deprecated. As of JDK version 1.1, replaced bygetComponentAt(int, int).ComponentComponent. locate(int x, int y)Deprecated. As of JDK version 1.1, replaced by getComponentAt(int, int).Methods in java.awt with parameters of type Component Modifier and Type Method and Description protected booleanDefaultFocusTraversalPolicy. accept(Component aComponent)Determines whether a Component is an acceptable choice as the new focus owner.protected booleanContainerOrderFocusTraversalPolicy. accept(Component aComponent)Determines whether a Component is an acceptable choice as the new focus owner.ComponentContainer. add(Component comp)Appends the specified component to the end of this container.ComponentContainer. add(Component comp, int index)Adds the specified component to this container at the given position.voidContainer. add(Component comp, java.lang.Object constraints)Adds the specified component to the end of this container.voidContainer. add(Component comp, java.lang.Object constraints, int index)Adds the specified component to this container with the specified constraints at the specified index.ComponentContainer. add(java.lang.String name, Component comp)Adds the specified component to this container.protected voidScrollPane. addImpl(Component comp, java.lang.Object constraints, int index)Adds the specified component to this scroll pane container.protected voidContainer. addImpl(Component comp, java.lang.Object constraints, int index)Adds the specified component to this container at the specified index.voidLayoutManager2. addLayoutComponent(Component comp, java.lang.Object constraints)Adds the specified component to the layout, using the specified constraint object.voidGridBagLayout. addLayoutComponent(Component comp, java.lang.Object constraints)Adds the specified component to the layout, using the specifiedconstraintsobject.voidCardLayout. addLayoutComponent(Component comp, java.lang.Object constraints)Adds the specified component to this card layout's internal table of names.voidBorderLayout. addLayoutComponent(Component comp, java.lang.Object constraints)Adds the specified component to the layout, using the specified constraint object.voidLayoutManager. addLayoutComponent(java.lang.String name, Component comp)If the layout manager uses a per-component string, adds the componentcompto the layout, associating it with the string specified byname.voidGridLayout. addLayoutComponent(java.lang.String name, Component comp)Adds the specified component with the specified name to the layout.voidGridBagLayout. addLayoutComponent(java.lang.String name, Component comp)Has no effect, since this layout manager does not use a per-component string.voidFlowLayout. addLayoutComponent(java.lang.String name, Component comp)Adds the specified component to the layout.voidCardLayout. addLayoutComponent(java.lang.String name, Component comp)Deprecated replaced byaddLayoutComponent(Component, Object).voidBorderLayout. addLayoutComponent(java.lang.String name, Component comp)Deprecated replaced byaddLayoutComponent(Component, Object).protected java.awt.peer.LightweightPeerToolkit. createComponent(Component target)Creates a peer for a component or container.<T extends java.awt.dnd.DragGestureRecognizer> TToolkit. createDragGestureRecognizer(java.lang.Class<T> abstractRecognizerClass, java.awt.dnd.DragSource ds, Component c, int srcActions, java.awt.dnd.DragGestureListener dgl)Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified.protected abstract voidKeyboardFocusManager. dequeueKeyEvents(long after, Component untilFocused)Called by the AWT to notify the KeyboardFocusManager that it should cancel delayed dispatching of KeyEvents.protected voidDefaultKeyboardFocusManager. dequeueKeyEvents(long after, Component untilFocused)Releases for normal dispatching to the current focus owner all KeyEvents which were enqueued because of a call toenqueueKeyEventswith the same timestamp and Component.protected abstract voidKeyboardFocusManager. discardKeyEvents(Component comp)Called by the AWT to notify the KeyboardFocusManager that it should cancel delayed dispatching of KeyEvents.protected voidDefaultKeyboardFocusManager. discardKeyEvents(Component comp)Discards all KeyEvents which were enqueued because of one or more calls toenqueueKeyEventswith the specified Component, or one of its descendants.protected abstract voidKeyboardFocusManager. enqueueKeyEvents(long after, Component untilFocused)Called by the AWT to notify the KeyboardFocusManager that it should delay dispatching of KeyEvents until the specified Component becomes the focus owner.protected voidDefaultKeyboardFocusManager. enqueueKeyEvents(long after, Component untilFocused)Delays dispatching of KeyEvents until the specified Component becomes the focus owner.abstract voidKeyboardFocusManager. focusNextComponent(Component aComponent)Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.voidDefaultKeyboardFocusManager. focusNextComponent(Component aComponent)Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.abstract voidKeyboardFocusManager. focusPreviousComponent(Component aComponent)Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.voidDefaultKeyboardFocusManager. focusPreviousComponent(Component aComponent)Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.abstract ComponentFocusTraversalPolicy. getComponentAfter(Container aContainer, Component aComponent)Returns the Component that should receive the focus after aComponent.ComponentContainerOrderFocusTraversalPolicy. getComponentAfter(Container aContainer, Component aComponent)Returns the Component that should receive the focus after aComponent.abstract ComponentFocusTraversalPolicy. getComponentBefore(Container aContainer, Component aComponent)Returns the Component that should receive the focus before aComponent.ComponentContainerOrderFocusTraversalPolicy. getComponentBefore(Container aContainer, Component aComponent)Returns the Component that should receive the focus before aComponent.intContainer. getComponentZOrder(Component comp)Returns the z-order index of the component inside the container.GridBagConstraintsGridBagLayout. getConstraints(Component comp)Gets the constraints for the specified component.java.lang.ObjectBorderLayout. getConstraints(Component comp)Gets the constraints for the specified componentprotected static ContainerToolkit. getNativeContainer(Component c)Give native peers the ability to query the native container given a native component (eg the direct parent may be lightweight).booleanContainer. isAncestorOf(Component c)Checks if the component is contained in the component hierarchy of this container.protected GridBagConstraintsGridBagLayout. lookupConstraints(Component comp)Retrieves the constraints for the specified component.abstract voidKeyboardFocusManager. processKeyEvent(Component focusedComponent, KeyEvent e)This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent.voidDefaultKeyboardFocusManager. processKeyEvent(Component focusedComponent, KeyEvent e)This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent.voidKeyboardFocusManager. redispatchEvent(Component target, AWTEvent e)Redispatches an AWTEvent in such a way that the AWT event dispatcher will not recursively request that the KeyboardFocusManager, or any installed KeyEventDispatchers, dispatch the event again.voidContainer. remove(Component comp)Removes the specified component from this container.voidLayoutManager. removeLayoutComponent(Component comp)Removes the specified component from the layout.voidGridLayout. removeLayoutComponent(Component comp)Removes the specified component from the layout.voidGridBagLayout. removeLayoutComponent(Component comp)Removes the specified component from this layout.voidFlowLayout. removeLayoutComponent(Component comp)Removes the specified component from the layout.voidCardLayout. removeLayoutComponent(Component comp)Removes the specified component from the layout.voidBorderLayout. removeLayoutComponent(Component comp)Removes the specified component from this border layout.voidContainer. setComponentZOrder(Component comp, int index)Moves the specified component to the specified z-order index in the container.voidGridBagLayout. setConstraints(Component comp, GridBagConstraints constraints)Sets the constraints for the specified component in this layout.protected voidKeyboardFocusManager. setGlobalFocusOwner(Component focusOwner)Sets the focus owner.protected voidKeyboardFocusManager. setGlobalPermanentFocusOwner(Component permanentFocusOwner)Sets the permanent focus owner.voidWindow. setLocationRelativeTo(Component c)Sets the location of the window relative to the specified component according to the following scenarios.voidPopupMenu. show(Component origin, int x, int y)Shows the popup menu at the x, y position relative to an origin component.abstract voidKeyboardFocusManager. upFocusCycle(Component aComponent)Moves the focus up one focus traversal cycle.voidDefaultKeyboardFocusManager. upFocusCycle(Component aComponent)Moves the focus up one focus traversal cycle.Constructors in java.awt with parameters of type Component Constructor and Description MediaTracker(Component comp)Creates a media tracker to track images for a given component. -
Uses of Component in java.awt.event
Methods in java.awt.event that return Component Modifier and Type Method and Description ComponentHierarchyEvent. getChanged()Returns the Component at the top of the hierarchy which was changed.ComponentContainerEvent. getChild()Returns the component that was affected by the event.ComponentHierarchyEvent. getComponent()Returns the originator of the event.ComponentComponentEvent. getComponent()Returns the originator of the event.ComponentFocusEvent. getOppositeComponent()Returns the other Component involved in this focus change.Constructors in java.awt.event with parameters of type Component Constructor and Description ComponentEvent(Component source, int id)Constructs aComponentEventobject.ContainerEvent(Component source, int id, Component child)Constructs aContainerEventobject.FocusEvent(Component source, int id)Constructs aFocusEventobject and identifies it as a permanent change in focus.FocusEvent(Component source, int id, boolean temporary)Constructs aFocusEventobject and identifies whether or not the change is temporary.FocusEvent(Component source, int id, boolean temporary, Component opposite)Constructs aFocusEventobject with the specified temporary state and oppositeComponent.HierarchyEvent(Component source, int id, Component changed, Container changedParent)Constructs anHierarchyEventobject to identify a change in theComponenthierarchy.HierarchyEvent(Component source, int id, Component changed, Container changedParent, long changeFlags)Constructs anHierarchyEventobject to identify a change in theComponenthierarchy.InputMethodEvent(Component source, int id, java.text.AttributedCharacterIterator text, int committedCharacterCount, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)Constructs anInputMethodEventwith the specified source component, type, text, caret, and visiblePosition.InputMethodEvent(Component source, int id, long when, java.text.AttributedCharacterIterator text, int committedCharacterCount, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)Constructs anInputMethodEventwith the specified source component, type, time, text, caret, and visiblePosition.InputMethodEvent(Component source, int id, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)Constructs anInputMethodEventwith the specified source component, type, caret, and visiblePosition.KeyEvent(Component source, int id, long when, int modifiers, int keyCode)Deprecated as of JDK1.1KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar)Constructs aKeyEventobject.KeyEvent(Component source, int id, long when, int modifiers, int keyCode, char keyChar, int keyLocation)Constructs aKeyEventobject.MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger)Constructs aMouseEventobject with the specified source component, type, modifiers, coordinates, click count, and popupTrigger flag.MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int button)Constructs aMouseEventobject with the specified source component, type, time, modifiers, coordinates, click count, popupTrigger flag, and button number.MouseEvent(Component source, int id, long when, int modifiers, int x, int y, int xAbs, int yAbs, int clickCount, boolean popupTrigger, int button)Constructs aMouseEventobject with the specified source component, type, time, modifiers, coordinates, absolute coordinates, click count, popupTrigger flag, and button number.MouseWheelEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, int scrollType, int scrollAmount, int wheelRotation)Constructs aMouseWheelEventobject with the specified source component, type, modifiers, coordinates, scroll type, scroll amount, and wheel rotation.MouseWheelEvent(Component source, int id, long when, int modifiers, int x, int y, int xAbs, int yAbs, int clickCount, boolean popupTrigger, int scrollType, int scrollAmount, int wheelRotation)Constructs aMouseWheelEventobject with the specified source component, type, modifiers, coordinates, absolute coordinates, scroll type, scroll amount, and wheel rotation.MouseWheelEvent(Component source, int id, long when, int modifiers, int x, int y, int xAbs, int yAbs, int clickCount, boolean popupTrigger, int scrollType, int scrollAmount, int wheelRotation, double preciseWheelRotation)Constructs aMouseWheelEventobject with the specified source component, type, modifiers, coordinates, absolute coordinates, scroll type, scroll amount, and wheel rotation.PaintEvent(Component source, int id, Rectangle updateRect)Constructs aPaintEventobject with the specified source component and type.
-
