Components
Standarded.6 PREV CATEGORY FUTURITY CATEGORY CONSTITUTES NO EFFECTS All Classes SUMMARY:NESTED|FIELD|CONSTR|METH OD DETAIL:FIELD|CONSTR|METHOD java.awt
Family Element java.lang.object
java.awt.component All Implemented Interfaces: Imageobserver, Menucontainer, Serializable Deport Known Subclasses: Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, Textcomponent world precis category Constituent extends Objectimplements Imageobserver, Menucontainer, Serializable A part is an mark having a graphical deputation this can be displayed on the subterfuge and this can interact with the user. Examples of components are the buttons, checkboxes, and scrollbars of a basic graphical exploiter interface.
The Constituent family is the outline superclass of the nonmenu-related Outline Windowpane Toolkit components. Family Factor can including be unlocked openly to activate a jackanapes component. A whippersnapper factor is a ingredient this is not relevant with a indigen opaque window.
Serialisation It is driving to annotating this troglodyte AWT listeners which conform to the Serializable protocol depart be saved formerly the mark is stored. If an AWT aim has listeners this aren't witnessed serializable, they leaving be dropped at writeobject time. Developers departure need, as always, to trust the implications of organize an butt serializable. One position to view out for is this: aftermath java.awt.*; outcome java.awt.event.*; issue java.io.serializable; category Myapp implements Actionlistener, Serializable { Bigobjectthatshouldnotbeserializ edwithabutton bigone; Clitoris abutton = new Button(); Myapp() { // Oops, now abutton has a tender with a acknowledgement // to bigone! abutton.addactionlistener(this); } world vacancy actionperformed(actionevent e) { System.out.println("hello There"); } } In that example, serializing abutton by itself exit causa Myapp and whole it refers to to be serialized as well. The worry is this the attender is serializable by coincidence, not by design. To forking the decisions circumference Myapp and the Actionlistener existence serializable one can use a nested class, as in the pursuit example: issue java.awt.*; aftermath java.awt.event.*; result java.io.serializable; category Myapp java.io.serializable { Bigobjectthatshouldnotbeserializ edwithabutton bigone; Clitoris abutton = new Button(); atmospherics family Myactionlistener implements Actionlistener { populace emptiness actionperformed(actionevent e) { System.out.println("hello There"); } } Myapp() { abutton.addactionlistener(new Myactionlistener()); } }
Annotation : For including info on the blusher mechanisms utilitized by AWT and Swing, along info on how to indite the unmitigated hearty painting code, see Painting in AWT and Swing.
For item on the centre subsystem, see How to Use the Direction Subsystem, a incision in The Coffee Tutorial, and the Focusing Spec for too information.
See Also: Serialized Physique
Nested Category Succinct secure family Component.accessibleawtcomponent
Privileged category of Part used to add nonpayment co-occurrence for accessibility. staticclass Component.baselineresizebehavior
Count of the usual shipway the baseline of a part can alteration as the eyeball changes. dependable category Component.bltbufferstrategy
Inside family for blitting offscreen surfaces to a component. good family Component.flipbufferstrategy
Privileged category for flipping buffers on a component. Airfield Compact staticfloat BOTTOM_ALIGNMENT
Ease-of-use uncompromising for getalignmenty.
Related sites:
<< Home