Java Doc for Component.java in  » 6.0-JDK-Modules » j2me » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.Component

All known Subclasses:   java.awt.Choice,  java.awt.Button,  java.awt.Canvas,  java.awt.Checkbox,  java.awt.TextComponent,  basis.DemoButton,  java.awt.Container,  java.awt.Scrollbar,  java.awt.List,  com.sun.jumpimpl.presentation.simplebasis.SimpleBasisAMSImageButton,  basis.Bean,  java.awt.Label,
Component
abstract public class Component implements ImageObserver,MenuContainer,Serializable(Code)
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 Component class is the abstract superclass of the nonmenu-related Abstract Window Toolkit components. Class Component can also be extended directly to create a lightweight component. A lightweight component is a component that is not associated with a native opaque window. NOTE: Changes to this class need to be synchronized with src/share/optional/pjae/java/awt/Component.java
version:
   1.9, 08/19/02
author:
   Nicholas Allen
author:
   Sami Shaio



Field Summary
final public static  floatBOTTOM_ALIGNMENT
     Ease-of-use constant for getAlignmentY.
final public static  floatCENTER_ALIGNMENT
     Ease-of-use constant for getAlignmentY and getAlignmentX.
final public static  floatLEFT_ALIGNMENT
     Ease-of-use constant for getAlignmentX.
final static  ObjectLOCK
     The locking object for AWT component-tree and layout operations.
final public static  floatRIGHT_ALIGNMENT
     Ease-of-use constant for getAlignmentX.
final public static  floatTOP_ALIGNMENT
     Ease-of-use constant for getAlignmentY().
final static  StringactionListenerK
    
final static  StringadjustmentListenerK
    
 Colorbackground
     The background color for this component.
transient  ComponentListenercomponentListener
    
final static  StringcomponentListenerK
    
final static  StringcontainerListenerK
    
 Cursorcursor
     The cursor displayed when pointer is over this component.
final static  booleandefaultNewEventsOnly
    
transient  Componentdelegate
     If this component delegates to another component then this is the component it delegates to.
transient  ComponentdelegateSource
     If this component is a delegate for an AWT Component then this represents the AWT component that delagtes to it.
 booleanenabled
     True when the object is enabled.
 longeventMask
    
transient  FocusListenerfocusListener
    
final static  StringfocusListenerK
    
 Fontfont
     The font used by this component.
 Colorforeground
     The foreground color for this component.
 intheight
     The height of the component.
static  intincRate
    
static  booleanisInc
     Static properties for incremental drawing.
final static  StringitemListenerK
    
transient  KeyListenerkeyListener
    
final static  StringkeyListenerK
    
 Localelocale
     The locale for the component.
 DimensionminSize
    
transient  MouseListenermouseListener
    
final static  StringmouseListenerK
    
transient  MouseMotionListenermouseMotionListener
    
final static  StringmouseMotionListenerK
    
 booleannewEventsOnly
    
transient  Containerparent
     The parent of the object.
 Vectorpopups
    
 DimensionprefSize
    
final static  StringtextListenerK
    
static  TimerupdateTimer
    
 booleanvalid
     True when the object is valid.
 booleanvisible
     True when the object is visible.
 intwidth
     The width of the component.
transient  RuntimeExceptionwindowClosingException
    
final static  StringwindowListenerK
    
 intx
     The x position of the component in the parent's coordinate system.
transient  ComponentXWindowxwindow
    
 inty
     The y position of the component in the parent's coordinate system.

Constructor Summary
protected  Component()
     Constructs a new component.

Method Summary
public  booleanaction(Event evt, Object what)
    
public synchronized  voidadd(PopupMenu popup)
     Adds the specified popup menu to the component.
public synchronized  voidaddComponentListener(ComponentListener l)
     Adds the specified component listener to receive component events from this component.
public synchronized  voidaddFocusListener(FocusListener l)
     Adds the specified focus listener to receive focus events from this component.
public synchronized  voidaddKeyListener(KeyListener l)
     Adds the specified key listener to receive key events from this component.
public synchronized  voidaddMouseListener(MouseListener l)
     Adds the specified mouse listener to receive mouse events from this component.
public synchronized  voidaddMouseMotionListener(MouseMotionListener l)
     Adds the specified mouse motion listener to receive mouse motion events from this component.
public  voidaddNotify()
     Notifies this component that it has been added to a container and if a peer is required, it should be created.
 booleanareInputMethodsEnabled()
    
public  Rectanglebounds()
    
final  voidcheckEnableNewEventsOnly(Object listener)
     Checks if newEventsOnly should be enabled when the specified listener is added.
public  intcheckImage(Image image, ImageObserver observer)
     Returns the status of the construction of a screen representation of the specified image.

This method does not cause the image to begin loading.

public  intcheckImage(Image image, int width, int height, ImageObserver observer)
     Returns the status of the construction of a screen representation of the specified image.

This method does not cause the image to begin loading.

protected  AWTEventcoalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
    
 StringconstructComponentName()
     Construct a name for this component.
public  booleancontains(int x, int y)
     Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.
public  booleancontains(Point p)
     Checks whether this component "contains" the specified point, where the point's x and y coordinates are defined to be relative to the coordinate system of this component.
public  ImagecreateImage(ImageProducer producer)
     Creates an image from the specified image producer.
public  ImagecreateImage(int width, int height)
     Creates an off-screen drawable image to be used for double buffering.
Parameters:
  width - the specified width.
Parameters:
  height - the specified height.
 ComponentXWindowcreateXWindow()
    
public  voiddeliverEvent(Event e)
    
public  voiddisable()
    
final protected  voiddisableEvents(long eventsToDisable)
     Disables the events defined by the specified event mask parameter from being delivered to this component.
final public  voiddispatchEvent(AWTEvent e)
     Dispatches an event to this component or one of its sub components.
 voiddispatchEventImpl(AWTEvent e)
    
public  voiddoLayout()
     Prompts the layout manager to lay out this component.
public  voidenable()
    
public  voidenable(boolean b)
    
final protected synchronized  voidenableEvents(long eventsToEnable)
     Enables the events defined by the specified event mask parameter to be delivered to this component.
 booleaneventEnabled(AWTEvent e)
    
 ComponentfindFocusDelegate(Container container)
     Recursively looks for the first component in container that is focus traversable.
public  floatgetAlignmentX()
     Returns the alignment along the x axis.
public  floatgetAlignmentY()
     Returns the alignment along the y axis.
public  ColorgetBackground()
     Gets the background color of this component. This component's background color.
public  RectanglegetBounds()
     Gets the bounds of this component in the form of a Rectangle object.
public  ColorModelgetColorModel()
     Gets the instance of ColorModel used to display the component on the output device.
public  ComponentgetComponentAt(int x, int y)
     Determines if this component or one of its immediate subcomponents contains the (xy) location, and if so, returns the containing component.
public  ComponentgetComponentAt(Point p)
     Returns the component or subcomponent that contains the specified point.
public  CursorgetCursor()
     Gets this component's cursor image.
 ComponentgetFocusDelegate()
     Gets the component to which key events should be deleagted to when this component has the focus.
public  FontgetFont()
     Gets the font of this component. This component's font.
 ComponentgetFontAndColorDelegate()
     Gets the component used to delegate setFont, setBackground, setForeground to.
public  FontMetricsgetFontMetrics(Font font)
     Gets the font metrics for the specified font. font The font for which font metrics is to beobtained.
public  ColorgetForeground()
     Gets the foreground color of this component. This component's foreground color.
public  GraphicsgetGraphics()
     Creates a graphics context for this component.
 InputContextgetInputContext()
     Gets the input context used by this component for handling the communication with input methods when text is entered in this component.
public  LocalegetLocale()
     Gets the locale of this component. This component's locale.
public  PointgetLocation()
     Gets the location of this component in the form of a point specifying the component's top-left corner.
public  PointgetLocationOnScreen()
     Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space.
public  DimensiongetMaximumSize()
     Gets the maximum size of this component.
public  DimensiongetMinimumSize()
     Gets the mininimum size of this component.
public  StringgetName()
     Gets the name of the component.
 ContainergetNativeContainer()
    
public  ContainergetParent()
     Gets the parent of this component.
public  DimensiongetPreferredSize()
     Gets the preferred size of this component.
public  DimensiongetSize()
     Returns the size of this component in the form of a Dimension object.
public  ToolkitgetToolkit()
     Gets this component's toolkit. Note that the frame that contains a component controls which toolkit is used by that component.
final public  ObjectgetTreeLock()
     Gets this component's locking object (the object that owns the thread sychronization monitor) for AWT component-tree and layout operations.
public  booleangotFocus(Event evt, Object what)
    
public  booleanhandleEvent(Event evt)
    
public  voidhide()
    
public  booleanimageUpdate(Image img, int flags, int x, int y, int w, int h)
     Repaints the component when the image has changed. This imageUpdate method of an ImageObserver is called when more information about an image which had been previously requested using an asynchronous routine such as the drawImage method of Graphics becomes available. See the definition of imageUpdate for more information on this method and its arguments.

The imageUpdate method of Component incrementally draws an image on the component as more of the bits of the image are available.

If the system property awt.image.incrementalDraw is missing or has the value true, the image is incrementally drawn, If the system property has any other value, then the image is not drawn until it has been completely loaded.

Also, if incremental drawing is in effect, the value of the system property awt.image.redrawrate is interpreted as an integer to give the maximum redraw rate, in milliseconds.

public  booleaninside(int x, int y)
    
public  voidinvalidate()
     Invalidates this component.
static  voidinvokeAndWait(Runnable runnable)
     Invokes the supplied Runnable's run method on the event dispatch thread.
public  booleanisDisplayable()
    
public  booleanisEnabled()
     Determines whether this component is enabled.
public  booleanisFocusTraversable()
     Returns the value of a flag that indicates whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
public  booleanisLightweight()
    
 booleanisLightweightWhenDisplayable()
     Returns whether this component is lightweight.
public  booleanisOpaque()
     Returns true if this component is completely opaque, returns false by default.

An opaque component paints every pixel within its rectangular region.

public  booleanisShowing()
     Determines whether this component is showing on screen.
public  booleanisValid()
     Determines whether this component is valid.
public  booleanisVisible()
     Determines whether this component is visible.
public  booleankeyDown(Event evt, int key)
    
public  booleankeyUp(Event evt, int key)
    
public  voidlayout()
    
 voidlightweightPrint(Graphics g)
     Simulates the peer callbacks into java.awt for printing of lightweight Components.
public  voidlist()
     Prints a listing of this component to the standard system output stream System.out.
public  voidlist(PrintStream out)
     Prints a listing of this component to the specified output stream.
public  voidlist(PrintStream out, int indent)
     Prints out a list, starting at the specified indention, to the specified print stream.
public  voidlist(PrintWriter out)
     Prints a listing to the specified print writer.
public  voidlist(PrintWriter out, int indent)
     Prints out a list, starting at the specified indention, to the specified print writer.
public  Componentlocate(int x, int y)
    
public  Pointlocation()
    
public  booleanlostFocus(Event evt, Object what)
    
public  DimensionminimumSize()
    
public  booleanmouseDown(Event evt, int x, int y)
    
public  booleanmouseDrag(Event evt, int x, int y)
    
public  booleanmouseEnter(Event evt, int x, int y)
    
public  booleanmouseExit(Event evt, int x, int y)
    
public  booleanmouseMove(Event evt, int x, int y)
    
public  booleanmouseUp(Event evt, int x, int y)
    
public  voidmove(int x, int y)
    
public  voidnextFocus()
    
public  voidpaint(Graphics g)
     Paints this component.
public  voidpaintAll(Graphics g)
     Paints this component and all of its subcomponents.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component.

protected  StringparamString()
     Returns the parameter string representing the state of this component.
public  booleanpostEvent(Event e)
    
public  DimensionpreferredSize()
    
public  booleanprepareImage(Image image, ImageObserver observer)
     Prepares an image for rendering on this component.
public  booleanprepareImage(Image image, int width, int height, ImageObserver observer)
     Prepares an image for rendering on this component at the specified width and height.

The image data is downloaded asynchronously in another thread, and an appropriately scaled screen representation of the image is generated.
Parameters:
  image - the instance of Imagefor which to prepare a screen representation.
Parameters:
  width - the width of the desired screen representation.
Parameters:
  height - the height of the desired screen representation.
Parameters:
  observer - the ImageObserver objectto be notified as the image is being prepared.

public  voidprint(Graphics g)
     Prints this component.
public  voidprintAll(Graphics g)
     Prints this component and all of its subcomponents.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component.

protected  voidprocessComponentEvent(ComponentEvent e)
     Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.

This method is not called unless component events are enabled for this component.

protected  voidprocessEvent(AWTEvent e)
     Processes events occurring on this component.
protected  voidprocessFocusEvent(FocusEvent e)
     Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.

This method is not called unless focus events are enabled for this component.

protected  voidprocessKeyEvent(KeyEvent e)
     Processes key events occurring on this component by dispatching them to any registered objects.

This method is not called unless key events are enabled for this component.

protected  voidprocessMouseEvent(MouseEvent e)
     Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

This method is not called unless mouse events are enabled for this component.

protected  voidprocessMouseMotionEvent(MouseEvent e)
     Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.

This method is not called unless mouse motion events are enabled for this component.

public synchronized  voidremove(MenuComponent popup)
     Removes the specified popup menu from the component.
public synchronized  voidremoveComponentListener(ComponentListener l)
     Removes the specified component listener so that it no longer receives component events from this component.
public synchronized  voidremoveFocusListener(FocusListener l)
     Removes the specified focus listener so that it no longer receives focus events from this component.
public synchronized  voidremoveKeyListener(KeyListener l)
     Removes the specified key listener so that it no longer receives key events from this component.
public synchronized  voidremoveMouseListener(MouseListener l)
     Removes the specified mouse listener so that it no longer receives mouse events from this component.
public synchronized  voidremoveMouseMotionListener(MouseMotionListener l)
     Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.
public  voidremoveNotify()
     Notifies this component that it has been removed from its container and if a peers exists, it destroys it.
public  voidrepaint()
     Repaints this component.
public  voidrepaint(long tm)
     Repaints the component.
public  voidrepaint(int x, int y, int width, int height)
     Repaints the specified rectangle of this component.
public  voidrepaint(long tm, int x, int y, int width, int height)
     Repaints the specified rectangle of this component within tm milliseconds.
public  voidrequestFocus()
     Requests that this component get the input focus.

This component's gotFocus method is called when this method is successful.

public  voidreshape(int x, int y, int width, int height)
    
public  voidresize(int width, int height)
    
public  voidresize(Dimension d)
    
public  voidsetBackground(Color c)
     Sets the background color of this component.
public  voidsetBounds(int x, int y, int width, int height)
     Moves and resizes this component.
public  voidsetBounds(Rectangle r)
     Moves and resizes this component to conform to the new bounding rectangle r.
public synchronized  voidsetCursor(Cursor cursor)
     Sets this components cursor image.
public  voidsetEnabled(boolean b)
     Enables or disables this component, depending on the value of the parameter b.
public  voidsetFont(Font f)
     Sets the font of this component.
public  voidsetForeground(Color c)
     Sets the foreground color of this component.
public  voidsetLocale(Locale l)
     Sets the locale of this component.
public  voidsetLocation(int x, int y)
     Moves this component to a new location.
public  voidsetLocation(Point p)
     Moves this component to a new location.
public  voidsetName(String name)
     Sets the name of the component to the specified string.
public  voidsetSize(int width, int height)
     Resizes this component so that it has width width and height. width The new width of this component in pixels.
public  voidsetSize(Dimension d)
     Resizes this component so that it has width d.width and height d.height.
public  voidsetVisible(boolean b)
     Shows or hides this component depending on the value of parameter b.
public  voidshow()
    
public  voidshow(boolean b)
    
public  Dimensionsize()
    
public  StringtoString()
     Returns a string representation of this component and its values.
public  voidtransferFocus()
     Transfers the focus to the next component.
public  voidupdate(Graphics g)
     Updates this component.

The AWT calls the update method in response to a call to repaint

public  voidvalidate()
     Ensures that this component has a valid layout.

Field Detail
BOTTOM_ALIGNMENT
final public static float BOTTOM_ALIGNMENT(Code)
Ease-of-use constant for getAlignmentY. Specifies an alignment to the bottom of the component.
See Also:   Component.getAlignmentY



CENTER_ALIGNMENT
final public static float CENTER_ALIGNMENT(Code)
Ease-of-use constant for getAlignmentY and getAlignmentX. Specifies an alignment to the center of the component
See Also:   Component.getAlignmentX
See Also:   Component.getAlignmentY



LEFT_ALIGNMENT
final public static float LEFT_ALIGNMENT(Code)
Ease-of-use constant for getAlignmentX. Specifies an alignment to the left side of the component.
See Also:   Component.getAlignmentX



LOCK
final static Object LOCK(Code)
The locking object for AWT component-tree and layout operations.
See Also:   Component.getTreeLock



RIGHT_ALIGNMENT
final public static float RIGHT_ALIGNMENT(Code)
Ease-of-use constant for getAlignmentX. Specifies an alignment to the right side of the component.
See Also:   Component.getAlignmentX



TOP_ALIGNMENT
final public static float TOP_ALIGNMENT(Code)
Ease-of-use constant for getAlignmentY(). Specifies an alignment to the top of the component.
See Also:   Component.getAlignmentY



actionListenerK
final static String actionListenerK(Code)
Internal, constants for serialization



adjustmentListenerK
final static String adjustmentListenerK(Code)



background
Color background(Code)
The background color for this component.
See Also:   Component.getBackground
See Also:   Component.setBackground



componentListener
transient ComponentListener componentListener(Code)



componentListenerK
final static String componentListenerK(Code)



containerListenerK
final static String containerListenerK(Code)



cursor
Cursor cursor(Code)
The cursor displayed when pointer is over this component.
See Also:   Component.getCursor
See Also:   Component.setCursor



defaultNewEventsOnly
final static boolean defaultNewEventsOnly(Code)



delegate
transient Component delegate(Code)
If this component delegates to another component then this is the component it delegates to.



delegateSource
transient Component delegateSource(Code)
If this component is a delegate for an AWT Component then this represents the AWT component that delagtes to it.



enabled
boolean enabled(Code)
True when the object is enabled. An object that is not enabled does not interact with the user.
See Also:   Component.isEnabled
See Also:   Component.setEnabled



eventMask
long eventMask(Code)



focusListener
transient FocusListener focusListener(Code)



focusListenerK
final static String focusListenerK(Code)



font
Font font(Code)
The font used by this component.
See Also:   Component.getFont
See Also:   Component.setFont



foreground
Color foreground(Code)
The foreground color for this component.
See Also:   Component.getForeground
See Also:   Component.setForeground



height
int height(Code)
The height of the component.
See Also:   Component.getSize



incRate
static int incRate(Code)



isInc
static boolean isInc(Code)
Static properties for incremental drawing.
See Also:   Component.imageUpdate



itemListenerK
final static String itemListenerK(Code)



keyListener
transient KeyListener keyListener(Code)



keyListenerK
final static String keyListenerK(Code)



locale
Locale locale(Code)
The locale for the component.
See Also:   Component.getLocale
See Also:   Component.setLocale



minSize
Dimension minSize(Code)
Internal, cached size information



mouseListener
transient MouseListener mouseListener(Code)



mouseListenerK
final static String mouseListenerK(Code)



mouseMotionListener
transient MouseMotionListener mouseMotionListener(Code)



mouseMotionListenerK
final static String mouseMotionListenerK(Code)



newEventsOnly
boolean newEventsOnly(Code)



parent
transient Container parent(Code)
The parent of the object. It may be null for top-level components.
See Also:   Component.getParent



popups
Vector popups(Code)



prefSize
Dimension prefSize(Code)
Internal, cached size information



textListenerK
final static String textListenerK(Code)



updateTimer
static Timer updateTimer(Code)



valid
boolean valid(Code)
True when the object is valid. An invalid object needs to be layed out. This flag is set to false when the object size is changed.
See Also:   Component.isValid
See Also:   Component.validate
See Also:   Component.invalidate



visible
boolean visible(Code)
True when the object is visible. An object that is not visible is not drawn on the screen.
See Also:   Component.isVisible
See Also:   Component.setVisible



width
int width(Code)
The width of the component.
See Also:   Component.getSize



windowClosingException
transient RuntimeException windowClosingException(Code)



windowListenerK
final static String windowListenerK(Code)



x
int x(Code)
The x position of the component in the parent's coordinate system.
See Also:   Component.getLocation



xwindow
transient ComponentXWindow xwindow(Code)
The XWindow used by this component
See Also:   Component.addNotify
See Also:   Component.removeNotify



y
int y(Code)
The y position of the component in the parent's coordinate system.
See Also:   Component.getLocation




Constructor Detail
Component
protected Component()(Code)
Constructs a new component. Class Component can be extended directly to create a lightweight component that does not utilize an opaque native window. A lightweight component must be hosted by a native container somewhere higher up in the component tree (for example, by a Frame object).




Method Detail
action
public boolean action(Event evt, Object what)(Code)



add
public synchronized void add(PopupMenu popup)(Code)
Adds the specified popup menu to the component.
Parameters:
  popup - the popup menu to be added to the component.
See Also:   java.awt.Component.remove(java.awt.MenuComponent)
since:
   JDK1.1



addComponentListener
public synchronized void addComponentListener(ComponentListener l)(Code)
Adds the specified component listener to receive component events from this component.
Parameters:
  l - the component listener.
See Also:   java.awt.event.ComponentEvent
See Also:   java.awt.event.ComponentListener
See Also:   java.awt.Component.removeComponentListener
since:
   JDK1.1



addFocusListener
public synchronized void addFocusListener(FocusListener l)(Code)
Adds the specified focus listener to receive focus events from this component.
Parameters:
  l - the focus listener.
See Also:   java.awt.event.FocusEvent
See Also:   java.awt.event.FocusListener
See Also:   java.awt.Component.removeFocusListener
since:
   JDK1.1



addKeyListener
public synchronized void addKeyListener(KeyListener l)(Code)
Adds the specified key listener to receive key events from this component.
Parameters:
  l - the key listener.
See Also:   java.awt.event.KeyEvent
See Also:   java.awt.event.KeyListener
See Also:   java.awt.Component.removeKeyListener
since:
   JDK1.1



addMouseListener
public synchronized void addMouseListener(MouseListener l)(Code)
Adds the specified mouse listener to receive mouse events from this component.
Parameters:
  l - the mouse listener.
See Also:   java.awt.event.MouseEvent
See Also:   java.awt.event.MouseListener
See Also:   java.awt.Component.removeMouseListener
since:
   JDK1.1



addMouseMotionListener
public synchronized void addMouseMotionListener(MouseMotionListener l)(Code)
Adds the specified mouse motion listener to receive mouse motion events from this component.
Parameters:
  l - the mouse motion listener.
See Also:   java.awt.event.MouseEvent
See Also:   java.awt.event.MouseMotionListener
See Also:   java.awt.Component.removeMouseMotionListener
since:
   JDK1.1



addNotify
public void addNotify()(Code)
Notifies this component that it has been added to a container and if a peer is required, it should be created. This method should be called by Container.add, and not by user code directly.
See Also:   Component.removeNotify
since:
   JDK1.0



areInputMethodsEnabled
boolean areInputMethodsEnabled()(Code)



bounds
public Rectangle bounds()(Code)



checkEnableNewEventsOnly
final void checkEnableNewEventsOnly(Object listener)(Code)
Checks if newEventsOnly should be enabled when the specified listener is added.



checkImage
public int checkImage(Image image, ImageObserver observer)(Code)
Returns the status of the construction of a screen representation of the specified image.

This method does not cause the image to begin loading. An application must use the prepareImage method to force the loading of an image.

Information on the flags returned by this method can be found with the discussion of the ImageObserver interface.
Parameters:
  image - the Image object whose statusis being checked.
Parameters:
  observer - the ImageObserverobject to be notified as the image is being prepared. the bitwise inclusive OR ofImageObserver flags indicating whatinformation about the image is currently available.
See Also:   java.awt.Component.prepareImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.Toolkit.checkImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.image.ImageObserver
since:
   JDK1.0




checkImage
public int checkImage(Image image, int width, int height, ImageObserver observer)(Code)
Returns the status of the construction of a screen representation of the specified image.

This method does not cause the image to begin loading. An application must use the prepareImage method to force the loading of an image.

The checkImage method of Component calls its peer's checkImage method to calculate the flags. If this component does not yet have a peer, the component's toolkit's checkImage method is called instead.

Information on the flags returned by this method can be found with the discussion of the ImageObserver interface.
Parameters:
  image - the Image object whose statusis being checked.
Parameters:
  width - the width of the scaled versionwhose status is to be checked.
Parameters:
  height - the height of the scaled versionwhose status is to be checked.
Parameters:
  observer - the ImageObserver objectto be notified as the image is being prepared. the bitwise inclusive OR ofImageObserver flags indicating whatinformation about the image is currently available.
See Also:   java.awt.Component.prepareImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.Toolkit.checkImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.image.ImageObserver
since:
   JDK1.0




coalesceEvents
protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)(Code)



constructComponentName
String constructComponentName()(Code)
Construct a name for this component. Called by getName() when the name is null.



contains
public boolean contains(int x, int y)(Code)
Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.
Parameters:
  x - the x coordinate of the point.
Parameters:
  y - the y coordinate of the point.
See Also:   java.awt.Component.getComponentAt(intint)
since:
   JDK1.1



contains
public boolean contains(Point p)(Code)
Checks whether this component "contains" the specified point, where the point's x and y coordinates are defined to be relative to the coordinate system of this component.
Parameters:
  p - the point.
See Also:   java.awt.Component.getComponentAt(java.awt.Point)
since:
   JDK1.1



createImage
public Image createImage(ImageProducer producer)(Code)
Creates an image from the specified image producer.
Parameters:
  producer - the image producer the image produced.
since:
   JDK1.0



createImage
public Image createImage(int width, int height)(Code)
Creates an off-screen drawable image to be used for double buffering.
Parameters:
  width - the specified width.
Parameters:
  height - the specified height. an off-screen drawable image,which can be used for double buffering.
since:
   JDK1.0



createXWindow
ComponentXWindow createXWindow()(Code)



deliverEvent
public void deliverEvent(Event e)(Code)



disable
public void disable()(Code)



disableEvents
final protected void disableEvents(long eventsToDisable)(Code)
Disables the events defined by the specified event mask parameter from being delivered to this component.
Parameters:
  eventsToDisable - the event mask defining the event types
See Also:   java.awt.Component.enableEvents
since:
   JDK1.1



dispatchEvent
final public void dispatchEvent(AWTEvent e)(Code)
Dispatches an event to this component or one of its sub components.
Parameters:
  e - the event



dispatchEventImpl
void dispatchEventImpl(AWTEvent e)(Code)



doLayout
public void doLayout()(Code)
Prompts the layout manager to lay out this component. This is usually called when the component (more specifically, container) is validated.
See Also:   Component.validate
See Also:   LayoutManager



enable
public void enable()(Code)



enable
public void enable(boolean b)(Code)



enableEvents
final protected synchronized void enableEvents(long eventsToEnable)(Code)
Enables the events defined by the specified event mask parameter to be delivered to this component.

Event types are automatically enabled when a listener for that event type is added to the component.

This method only needs to be invoked by subclasses of Component which desire to have the specified event types delivered to processEvent regardless of whether or not a listener is registered.
Parameters:
  eventsToEnable - the event mask defining the event types.
See Also:   java.awt.Component.processEvent
See Also:   java.awt.Component.disableEvents
since:
   JDK1.1




eventEnabled
boolean eventEnabled(AWTEvent e)(Code)



findFocusDelegate
Component findFocusDelegate(Container container)(Code)
Recursively looks for the first component in container that is focus traversable.



getAlignmentX
public float getAlignmentX()(Code)
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.



getAlignmentY
public float getAlignmentY()(Code)
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.



getBackground
public Color getBackground()(Code)
Gets the background color of this component. This component's background color. If this component doesnot have a background color, the background color of its parentis returned.
See Also:   java.awt.Component.setBackground(java.awt.Color)
since:
   JDK1.0



getBounds
public Rectangle getBounds()(Code)
Gets the bounds of this component in the form of a Rectangle object. The bounds specify this component's width, height, and location relative to its parent. A rectangle indicating this component's bounds.
See Also:   Component.setBounds
See Also:   Component.getLocation
See Also:   Component.getSize



getColorModel
public ColorModel getColorModel()(Code)
Gets the instance of ColorModel used to display the component on the output device. The color model used by this component.
See Also:   java.awt.image.ColorModel
See Also:   sun.awt.peer.ComponentPeer.getColorModel
See Also:   java.awt.Toolkit.getColorModel
since:
   JDK1.0



getComponentAt
public Component getComponentAt(int x, int y)(Code)
Determines if this component or one of its immediate subcomponents contains the (xy) location, and if so, returns the containing component. This method only looks one level deep. If the point (xy) is inside a subcomponent that itself has subcomponents, it does not go looking down the subcomponent tree.

The locate method of Component simply returns the component itself if the (xy) coordinate location is inside its bounding box, and null otherwise.
Parameters:
  x - the x coordinate.
Parameters:
  y - the y coordinate. the component or subcomponent that contains the(xy) location;null if the locationis outside this component.
See Also:   java.awt.Component.contains(intint)
since:
   JDK1.0




getComponentAt
public Component getComponentAt(Point p)(Code)
Returns the component or subcomponent that contains the specified point.
Parameters:
  p - the point.
See Also:   java.awt.Component.contains
since:
   JDK1.1



getCursor
public Cursor getCursor()(Code)
Gets this component's cursor image.

Compatibility

If setCursor is not always ignored, getCursor() must provide a cursor that will not be ignored when setCursor is called so that an application may restore the cursor after setting it. The cursor for this component.
See Also:   java.awt.Component.setCursor
See Also:   java.awt.Cursor
since:
   JDK1.1



getFocusDelegate
Component getFocusDelegate()(Code)
Gets the component to which key events should be deleagted to when this component has the focus.



getFont
public Font getFont()(Code)
Gets the font of this component. This component's font. If a font has not been setfor this component, the font of its parent is returned.
See Also:   Component.setFont
since:
   JDK1.0



getFontAndColorDelegate
Component getFontAndColorDelegate()(Code)
Gets the component used to delegate setFont, setBackground, setForeground to.



getFontMetrics
public FontMetrics getFontMetrics(Font font)(Code)
Gets the font metrics for the specified font. font The font for which font metrics is to beobtained. The font metrics for font.
Parameters:
  font - the font. the font metrics for the specified font.
See Also:   java.awt.Component.getFont
See Also:   java.awt.Component.getPeer
See Also:   sun.awt.peer.ComponentPeer.getFontMetrics(java.awt.Font)
See Also:   java.awt.Toolkit.getFontMetrics(java.awt.Font)
since:
   JDK1.0



getForeground
public Color getForeground()(Code)
Gets the foreground color of this component. This component's foreground color. If this component doesnot have a foreground color, the foreground color of its parentis returned.
See Also:   Component.setForeground(java.awt.Color)
since:
   JDK1.0



getGraphics
public Graphics getGraphics()(Code)
Creates a graphics context for this component. This method will return null if this component is currently not on the screen. A graphics context for this component, or nullif it has none.
See Also:   java.awt.Component.paint
since:
   JDK1.0



getInputContext
InputContext getInputContext()(Code)
Gets the input context used by this component for handling the communication with input methods when text is entered in this component. By default, the input context used for the parent component is returned. Components may override this to return a private input context. The input context used by this component. Null if no context canbe determined.



getLocale
public Locale getLocale()(Code)
Gets the locale of this component. This component's locale. If this component does nothave a locale, the locale of its parent is returned.
See Also:   Component.setLocale
exception:
  IllegalComponentStateException - If the Componentdoes not have its own locale and has not yet been added toa containment hierarchy such that the locale can be determinedfrom the containing parent.
since:
   JDK1.1



getLocation
public Point getLocation()(Code)
Gets the location of this component in the form of a point specifying the component's top-left corner. The location will be relative to the parent's coordinate space. An instance of Point representingthe top-left corner of the component's bounds in the coordinatespace of the component's parent.
See Also:   Component.setLocation
See Also:   Component.getLocationOnScreen
since:
   JDK1.1



getLocationOnScreen
public Point getLocationOnScreen()(Code)
Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space. An instance of Point representingthe top-left corner of the component's bounds in thecoordinate space of the screen.
See Also:   Component.setLocation
See Also:   Component.getLocation



getMaximumSize
public Dimension getMaximumSize()(Code)
Gets the maximum size of this component. A dimension object indicating this component's maximum size.
See Also:   Component.getMinimumSize
See Also:   Component.getPreferredSize
See Also:   LayoutManager



getMinimumSize
public Dimension getMinimumSize()(Code)
Gets the mininimum size of this component. A dimension object indicating this component's minimum size.
See Also:   Component.getPreferredSize
See Also:   java.awt.LayoutManager



getName
public String getName()(Code)
Gets the name of the component. This component's name.
See Also:   Component.setName
since:
   JDK1.1



getNativeContainer
Container getNativeContainer()(Code)



getParent
public Container getParent()(Code)
Gets the parent of this component. The parent container of this component.
since:
   JDK1.0



getPreferredSize
public Dimension getPreferredSize()(Code)
Gets the preferred size of this component. A dimension object indicating this component's preferred size.
See Also:   Component.getMinimumSize
See Also:   java.awt.LayoutManager



getSize
public Dimension getSize()(Code)
Returns the size of this component in the form of a Dimension object. The height field of the Dimension object contains this component's height, and the width field of the Dimension object contains this component's width. A Dimension object that indicates thesize of this component.
See Also:   Component.setSize
since:
   JDK1.1



getToolkit
public Toolkit getToolkit()(Code)
Gets this component's toolkit. Note that the frame that contains a component controls which toolkit is used by that component. Therefore if the component is moved from one frame to another, the toolkit it uses may change.

Compatibility

Personal Profile does not require that an AWT implementation use the peer interfaces, so many methods in the toolkit may throw an UnsupportedOperationException. The toolkit of this component.
See Also:   Component.getPeer
See Also:   java.awt.Toolkit
since:
   JDK1.0



getTreeLock
final public Object getTreeLock()(Code)
Gets this component's locking object (the object that owns the thread sychronization monitor) for AWT component-tree and layout operations. This component's locking object.



gotFocus
public boolean gotFocus(Event evt, Object what)(Code)



handleEvent
public boolean handleEvent(Event evt)(Code)



hide
public void hide()(Code)



imageUpdate
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)(Code)
Repaints the component when the image has changed. This imageUpdate method of an ImageObserver is called when more information about an image which had been previously requested using an asynchronous routine such as the drawImage method of Graphics becomes available. See the definition of imageUpdate for more information on this method and its arguments.

The imageUpdate method of Component incrementally draws an image on the component as more of the bits of the image are available.

If the system property awt.image.incrementalDraw is missing or has the value true, the image is incrementally drawn, If the system property has any other value, then the image is not drawn until it has been completely loaded.

Also, if incremental drawing is in effect, the value of the system property awt.image.redrawrate is interpreted as an integer to give the maximum redraw rate, in milliseconds. If the system property is missing or cannot be interpreted as an integer, the redraw rate is once every 100ms.

The interpretation of the x, y, width, and height arguments depends on the value of the infoflags argument.
Parameters:
  img - the image being observed.
Parameters:
  infoflags - see imageUpdate for more information.
Parameters:
  x - the x coordinate.
Parameters:
  y - the y coordinate.
Parameters:
  width - the width.
Parameters:
  height - the height. true if the flags indicate that theimage is completely loaded;false otherwise.
See Also:   java.awt.image.ImageObserver
See Also:   java.awt.Graphics.drawImage(java.awt.Imageintintjava.awt.Colorjava.awt.image.ImageObserver)
See Also:   java.awt.Graphics.drawImage(java.awt.Imageintintjava.awt.image.ImageObserver)
See Also:   java.awt.Graphics.drawImage(java.awt.Imageintintintintjava.awt.Colorjava.awt.image.ImageObserver)
See Also:   java.awt.Graphics.drawImage(java.awt.Imageintintintintjava.awt.image.ImageObserver)
See Also:   java.awt.image.ImageObserver.imageUpdate(java.awt.Imageintintintintint)
since:
   JDK1.0




inside
public boolean inside(int x, int y)(Code)



invalidate
public void invalidate()(Code)
Invalidates this component. This component and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly.
See Also:   java.awt.Component.validate
See Also:   java.awt.Component.doLayout
See Also:   java.awt.LayoutManager
since:
   JDK1.0



invokeAndWait
static void invokeAndWait(Runnable runnable)(Code)
Invokes the supplied Runnable's run method on the event dispatch thread. This is slightly different from the EventQueue.invokeAndWait because it can be called from any thread whereas EventQueue.invokeAndWait cannot be called from the event dispatch thread. If called from the event dispatch thread the run method will be run immediately. Also, any exceptions thrown are caught. This method is convienient if you need to invoke code on a delegate component that is not thread safe (e.g. Swing components).



isDisplayable
public boolean isDisplayable()(Code)



isEnabled
public boolean isEnabled()(Code)
Determines whether this component is enabled. An enabled component can respond to user input and generate events. Components are enabled initially by default. A component may be enabled or disabled by calling its setEnabled method. true if the component is enabled;false otherwise.
See Also:   Component.setEnabled
since:
   JDK1.0



isFocusTraversable
public boolean isFocusTraversable()(Code)
Returns the value of a flag that indicates whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal. If this method returns "false", this component may still request the keyboard focus using requestFocus(), but it will not automatically be assigned focus during tab traversal. true if this component isfocus-traverable; false otherwise.
since:
   JDK1.1



isLightweight
public boolean isLightweight()(Code)



isLightweightWhenDisplayable
boolean isLightweightWhenDisplayable()(Code)
Returns whether this component is lightweight. This method exists because isLightweight is defined to return false when this component is not displayable. This allows us to determine if this component is really lightweight, regardless of whether it is displayable or not.



isOpaque
public boolean isOpaque()(Code)
Returns true if this component is completely opaque, returns false by default.

An opaque component paints every pixel within its rectangular region. A non-opaque component paints only some of its pixels, allowing the pixels underneath it to "show through". A component that does not fully paint its pixels therefore provides a degree of transparency. Only lightweight components can be transparent.

Subclasses that guarantee to always completely paint their contents should override this method and return true. All of the "heavyweight" AWT components are opaque. true if this component is completely opaque.
See Also:   Component.isLightweight
since:
   1.2




isShowing
public boolean isShowing()(Code)
Determines whether this component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing. true if the component is showing;false otherwise.
See Also:   Component.setVisible
since:
   JDK1.0



isValid
public boolean isValid()(Code)
Determines whether this component is valid. Components are invalidated when they are first shown on the screen. true if the component is valid; falseotherwise.
See Also:   Component.validate
See Also:   Component.invalidate
since:
   JDK1.0



isVisible
public boolean isVisible()(Code)
Determines whether this component is visible. Components are initially visible, with the exception of top level components such as Frame objects. true if the component is visible;false otherwise.
See Also:   Component.setVisible
since:
   JDK1.0



keyDown
public boolean keyDown(Event evt, int key)(Code)



keyUp
public boolean keyUp(Event evt, int key)(Code)



layout
public void layout()(Code)



lightweightPrint
void lightweightPrint(Graphics g)(Code)
Simulates the peer callbacks into java.awt for printing of lightweight Components.
Parameters:
  g - the graphics context to use for printing.
See Also:   Component.printAll



list
public void list()(Code)
Prints a listing of this component to the standard system output stream System.out.
See Also:   java.lang.System.out
since:
   JDK1.0



list
public void list(PrintStream out)(Code)
Prints a listing of this component to the specified output stream.
Parameters:
  out - a print stream.
since:
   JDK1.0



list
public void list(PrintStream out, int indent)(Code)
Prints out a list, starting at the specified indention, to the specified print stream.
Parameters:
  out - a print stream.
Parameters:
  indent - number of spaces to indent.
See Also:   java.io.PrintStream.println(java.lang.Object)
since:
   JDK1.0



list
public void list(PrintWriter out)(Code)
Prints a listing to the specified print writer.
Parameters:
  out - The print writer to print to.
since:
   JDK1.1



list
public void list(PrintWriter out, int indent)(Code)
Prints out a list, starting at the specified indention, to the specified print writer.
Parameters:
  out - The print writer to print to.
Parameters:
  indent - The number of spaces to indent.
See Also:   java.io.PrintStream.println(java.lang.Object)
since:
   JDK1.1



locate
public Component locate(int x, int y)(Code)



location
public Point location()(Code)



lostFocus
public boolean lostFocus(Event evt, Object what)(Code)



minimumSize
public Dimension minimumSize()(Code)



mouseDown
public boolean mouseDown(Event evt, int x, int y)(Code)



mouseDrag
public boolean mouseDrag(Event evt, int x, int y)(Code)



mouseEnter
public boolean mouseEnter(Event evt, int x, int y)(Code)



mouseExit
public boolean mouseExit(Event evt, int x, int y)(Code)



mouseMove
public boolean mouseMove(Event evt, int x, int y)(Code)



mouseUp
public boolean mouseUp(Event evt, int x, int y)(Code)



move
public void move(int x, int y)(Code)



nextFocus
public void nextFocus()(Code)



paint
public void paint(Graphics g)(Code)
Paints this component. This method is called when the contents of the component should be painted in response to the component first being shown or damage needing repair. The clip rectangle in the Graphics parameter will be set to the area which needs to be painted. g The graphics context to use for painting.
See Also:   java.awt.Component.update
since:
   JDK1.0



paintAll
public void paintAll(Graphics g)(Code)
Paints this component and all of its subcomponents.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.
Parameters:
  g - the graphics context to use for painting.
See Also:   java.awt.Component.paint
since:
   JDK1.0




paramString
protected String paramString()(Code)
Returns the parameter string representing the state of this component. This string is useful for debugging. the parameter string of this component.
since:
   JDK1.0



postEvent
public boolean postEvent(Event e)(Code)



preferredSize
public Dimension preferredSize()(Code)



prepareImage
public boolean prepareImage(Image image, ImageObserver observer)(Code)
Prepares an image for rendering on this component. The image data is downloaded asynchronously in another thread and the appropriate screen representation of the image is generated.
Parameters:
  image - the Image for which toprepare a screen representation.
Parameters:
  observer - the ImageObserver objectto be notified as the image is being prepared. true if the image has already been fully prepared;false otherwise.
since:
   JDK1.0



prepareImage
public boolean prepareImage(Image image, int width, int height, ImageObserver observer)(Code)
Prepares an image for rendering on this component at the specified width and height.

The image data is downloaded asynchronously in another thread, and an appropriately scaled screen representation of the image is generated.
Parameters:
  image - the instance of Imagefor which to prepare a screen representation.
Parameters:
  width - the width of the desired screen representation.
Parameters:
  height - the height of the desired screen representation.
Parameters:
  observer - the ImageObserver objectto be notified as the image is being prepared. true if the image has already been fully prepared;false otherwise.
See Also:   java.awt.image.ImageObserver
since:
   JDK1.0




print
public void print(Graphics g)(Code)
Prints this component. Applications should override this method for components that must do special processing before being printed or should be printed differently than they are painted.

The default implementation of this method calls the paint method.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.
Parameters:
  g - the graphics context to use for printing.
See Also:   java.awt.Component.paint(java.awt.Graphics)
since:
   JDK1.0




printAll
public void printAll(Graphics g)(Code)
Prints this component and all of its subcomponents.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.
Parameters:
  g - the graphics context to use for printing.
See Also:   java.awt.Component.print(java.awt.Graphics)
since:
   JDK1.0




processComponentEvent
protected void processComponentEvent(ComponentEvent e)(Code)
Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.

This method is not called unless component events are enabled for this component. Component events are enabled when one of the following occurs:

  • A ComponentListener object is registered via addComponentListener.
  • Component events are enabled via enableEvents.

Parameters:
  e - the component event.
See Also:   java.awt.event.ComponentEvent
See Also:   java.awt.event.ComponentListener
See Also:   java.awt.Component.addComponentListener
See Also:   java.awt.Component.enableEvents
since:
   JDK1.1



processEvent
protected void processEvent(AWTEvent e)(Code)
Processes events occurring on this component. By default this method calls the appropriate process<event type>Event method for the given class of event.
Parameters:
  e - the event.
See Also:   java.awt.Component.processComponentEvent
See Also:   java.awt.Component.processFocusEvent
See Also:   java.awt.Component.processKeyEvent
See Also:   java.awt.Component.processMouseEvent
See Also:   java.awt.Component.processMouseMotionEvent
since:
   JDK1.1



processFocusEvent
protected void processFocusEvent(FocusEvent e)(Code)
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.

This method is not called unless focus events are enabled for this component. Focus events are enabled when one of the following occurs:

  • A FocusListener object is registered via addFocusListener.
  • Focus events are enabled via enableEvents.

Parameters:
  e - the focus event.
See Also:   java.awt.event.FocusEvent
See Also:   java.awt.event.FocusListener
See Also:   java.awt.Component.addFocusListener
See Also:   java.awt.Component.enableEvents
since:
   JDK1.1



processKeyEvent
protected void processKeyEvent(KeyEvent e)(Code)
Processes key events occurring on this component by dispatching them to any registered objects.

This method is not called unless key events are enabled for this component. Key events are enabled when one of the following occurs:

  • A KeyListener object is registered via addKeyListener.
  • Key events are enabled via enableEvents.

Parameters:
  e - the key event.
See Also:   java.awt.event.KeyEvent
See Also:   java.awt.event.KeyListener
See Also:   java.awt.Component.addKeyListener
See Also:   java.awt.Component.enableEvents
since:
   JDK1.1



processMouseEvent
protected void processMouseEvent(MouseEvent e)(Code)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

This method is not called unless mouse events are enabled for this component. Mouse events are enabled when one of the following occurs:

  • A MouseListener object is registered via addMouseListener.
  • Mouse events are enabled via enableEvents.

Parameters:
  e - the mouse event.
See Also:   java.awt.event.MouseEvent
See Also:   java.awt.event.MouseListener
See Also:   java.awt.Component.addMouseListener
See Also:   java.awt.Component.enableEvents
since:
   JDK1.1



processMouseMotionEvent
protected void processMouseMotionEvent(MouseEvent e)(Code)
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.

This method is not called unless mouse motion events are enabled for this component. Mouse motion events are enabled when one of the following occurs:

  • A MouseMotionListener object is registered via addMouseMotionListener.
  • Mouse motion events are enabled via enableEvents.

Parameters:
  e - the mouse motion event.
See Also:   java.awt.event.MouseEvent
See Also:   java.awt.event.MouseMotionListener
See Also:   java.awt.Component.addMouseMotionListener
See Also:   java.awt.Component.enableEvents
since:
   JDK1.1



remove
public synchronized void remove(MenuComponent popup)(Code)
Removes the specified popup menu from the component.
Parameters:
  popup - the popup menu to be removed.
See Also:   java.awt.Component.add(java.awt.PopupMenu)
since:
   JDK1.1



removeComponentListener
public synchronized void removeComponentListener(ComponentListener l)(Code)
Removes the specified component listener so that it no longer receives component events from this component.
Parameters:
  l - the component listener.
See Also:   java.awt.event.ComponentEvent
See Also:   java.awt.event.ComponentListener
See Also:   java.awt.Component.addComponentListener
since:
   JDK1.1



removeFocusListener
public synchronized void removeFocusListener(FocusListener l)(Code)
Removes the specified focus listener so that it no longer receives focus events from this component.
Parameters:
  l - the focus listener.
See Also:   java.awt.event.FocusEvent
See Also:   java.awt.event.FocusListener
See Also:   java.awt.Component.addFocusListener
since:
   JDK1.1



removeKeyListener
public synchronized void removeKeyListener(KeyListener l)(Code)
Removes the specified key listener so that it no longer receives key events from this component.
Parameters:
  l - the key listener.
See Also:   java.awt.event.KeyEvent
See Also:   java.awt.event.KeyListener
See Also:   java.awt.Component.addKeyListener
since:
   JDK1.1



removeMouseListener
public synchronized void removeMouseListener(MouseListener l)(Code)
Removes the specified mouse listener so that it no longer receives mouse events from this component.
Parameters:
  l - the mouse listener.
See Also:   java.awt.event.MouseEvent
See Also:   java.awt.event.MouseListener
See Also:   java.awt.Component.addMouseListener
since:
   JDK1.1



removeMouseMotionListener
public synchronized void removeMouseMotionListener(MouseMotionListener l)(Code)
Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.
Parameters:
  l - the mouse motion listener.
See Also:   java.awt.event.MouseEvent
See Also:   java.awt.event.MouseMotionListener
See Also:   java.awt.Component.addMouseMotionListener
since:
   JDK1.1



removeNotify
public void removeNotify()(Code)
Notifies this component that it has been removed from its container and if a peers exists, it destroys it. This method should be called by Container.remove, and not by user code directly.
See Also:   Component.addNotify



repaint
public void repaint()(Code)
Repaints this component.

This method causes a call to this component's update method as soon as possible.
See Also:   java.awt.Component.update(java.awt.Graphics)
since:
   JDK1.0




repaint
public void repaint(long tm)(Code)
Repaints the component. This will result in a call to update within tm milliseconds.
Parameters:
  tm - maximum time in milliseconds before update
See Also:   Component.paint
See Also:   java.awt.Component.update(java.awt.Graphics)
since:
   JDK1.0



repaint
public void repaint(int x, int y, int width, int height)(Code)
Repaints the specified rectangle of this component.

This method causes a call to this component's update method as soon as possible.
Parameters:
  x - the x coordinate.
Parameters:
  y - the y coordinate.
Parameters:
  width - the width.
Parameters:
  height - the height.
See Also:   java.awt.Component.update(java.awt.Graphics)
since:
   JDK1.0




repaint
public void repaint(long tm, int x, int y, int width, int height)(Code)
Repaints the specified rectangle of this component within tm milliseconds.

This method causes a call to this component's update method.
Parameters:
  tm - maximum time in milliseconds before update.
Parameters:
  x - the x coordinate.
Parameters:
  y - the y coordinate.
Parameters:
  width - the width.
Parameters:
  height - the height.
See Also:   java.awt.Component.update(java.awt.Graphics)
since:
   JDK1.0




requestFocus
public void requestFocus()(Code)
Requests that this component get the input focus.

This component's gotFocus method is called when this method is successful. The component must be visible on the screen for this request to be granted
See Also:   FocusEvent
See Also:   Component.addFocusListener
See Also:   Component.processFocusEvent
See Also:   Component.isFocusTraversable
since:
   JDK1.0




reshape
public void reshape(int x, int y, int width, int height)(Code)



resize
public void resize(int width, int height)(Code)



resize
public void resize(Dimension d)(Code)



setBackground
public void setBackground(Color c)(Code)
Sets the background color of this component. c The color to become this component'sbackground color.
See Also:   Component.getBackground
since:
   JDK1.0



setBounds
public void setBounds(int x, int y, int width, int height)(Code)
Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height. x The new x-coordinate of this component. y The new y-coordinate of this component. width The new width of this component. height The new height of thiscomponent.
See Also:   java.awt.Component.getBounds
See Also:   java.awt.Component.setLocation(intint)
See Also:   java.awt.Component.setLocation(java.awt.Point)
See Also:   java.awt.Component.setSize(intint)
See Also:   java.awt.Component.setSize(java.awt.Dimension)



setBounds
public void setBounds(Rectangle r)(Code)
Moves and resizes this component to conform to the new bounding rectangle r. This component's new position is specified by r.x and r.y, and its new size is specified by r.width and r.height r The new bounding rectangle for this component.
See Also:   java.awt.Component.getBounds
See Also:   java.awt.Component.setLocation(intint)
See Also:   java.awt.Component.setLocation(java.awt.Point)
See Also:   java.awt.Component.setSize(intint)
See Also:   java.awt.Component.setSize(java.awt.Dimension)
since:
   JDK1.1



setCursor
public synchronized void setCursor(Cursor cursor)(Code)
Sets this components cursor image.

Compatibility

In PersonalJava and PersonalProfile, if the underlying platform does not support cursors or has limited cursor support, the setCursor method can be ignored.

If the setCuror method ignores some, but not all cursors, it is important that getCursor() returns a cursor that will not be ignored so that an application can restore the cursor accordingly. cursor the non-null cursor image.
See Also:   java.awt.Component.getCursor
See Also:   java.awt.Cursor
since:
   JDK1.1




setEnabled
public void setEnabled(boolean b)(Code)
Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default. b If true, this component isenabled; otherwise this component is disabled.
See Also:   Component.isEnabled
since:
   JDK1.1



setFont
public void setFont(Font f)(Code)
Sets the font of this component. f The font to become this component's font.
See Also:   Component.getFont
since:
   JDK1.0



setForeground
public void setForeground(Color c)(Code)
Sets the foreground color of this component. c The color to become this component'sforeground color.
See Also:   Component.getForeground
since:
   JDK1.0



setLocale
public void setLocale(Locale l)(Code)
Sets the locale of this component. l The locale to become this component's locale.
See Also:   Component.getLocale
since:
   JDK1.1



setLocation
public void setLocation(int x, int y)(Code)
Moves this component to a new location. The top-left corner of the new location is specified by the x and y parameters in the coordinate space of this component's parent. x The x-coordinate of the new location'stop-left corner in the parent's coordinate space. y The y-coordinate of the new location'stop-left corner in the parent's coordinate space.
See Also:   Component.getLocation
See Also:   Component.setBounds
since:
   JDK1.1



setLocation
public void setLocation(Point p)(Code)
Moves this component to a new location. The top-left corner of the new location is specified by point p. Point p is given in the parent's coordinate space. p The point defining the top-left cornerof the new location, given in the coordinate space of thiscomponent's parent.
See Also:   Component.getLocation
See Also:   Component.setBounds
since:
   JDK1.1



setName
public void setName(String name)(Code)
Sets the name of the component to the specified string. name The string that is to be thiscomponent's name.
See Also:   Component.getName
since:
   JDK1.1



setSize
public void setSize(int width, int height)(Code)
Resizes this component so that it has width width and height. width The new width of this component in pixels. height The new height of this component in pixels.
See Also:   Component.getSize
See Also:   Component.setBounds
since:
   JDK1.1



setSize
public void setSize(Dimension d)(Code)
Resizes this component so that it has width d.width and height d.height. d The dimension specifying the new sizeof this component.
See Also:   Component.setSize
See Also:   Component.setBounds
since:
   JDK1.1



setVisible
public void setVisible(boolean b)(Code)
Shows or hides this component depending on the value of parameter b. b If true, shows this component;otherwise, hides this component.
See Also:   Component.isVisible
since:
   JDK1.1



show
public void show()(Code)



show
public void show(boolean b)(Code)



size
public Dimension size()(Code)



toString
public String toString()(Code)
Returns a string representation of this component and its values. a string representation of this component.
since:
   JDK1.0



transferFocus
public void transferFocus()(Code)
Transfers the focus to the next component.
See Also:   java.awt.Component.requestFocus
See Also:   java.awt.Component.gotFocus
since:
   JDK1.1s



update
public void update(Graphics g)(Code)
Updates this component.

The AWT calls the update method in response to a call to repaintupdate or paint. You can assume that the background is not cleared.

The updatemethod of Component does the following:

  • Clears this component by filling it with the background color.
  • Sets the color of the graphics context to be the foreground color of this component.
  • Calls this component's paint method to completely redraw this component.

The origin of the graphics context, its (00) coordinate point, is the top-left corner of this component. The clipping region of the graphics context is the bounding rectangle of this component.
Parameters:
  g - the specified context to use for updating.
See Also:   java.awt.Component.paint
See Also:   java.awt.Component.repaint
since:
   JDK1.0




validate
public void validate()(Code)
Ensures that this component has a valid layout. This method is primarily intended to operate on instances of Container.
See Also:   java.awt.Component.invalidate
See Also:   java.awt.Component.doLayout
See Also:   java.awt.LayoutManager
See Also:   java.awt.Container.validate
since:
   JDK1.0



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.