peer : Java Glossary

peer
Associated with each Component are three objects:
  1. the standard AWT (Advanced Windowing Toolkit) button object.
  2. a peer mirroring interfacing button object constructed in the style that the native GUI (Graphic User Interface) likes.
  3. perhaps also a hidden button object internal to the native GUI.
The behaviour of the particular Component can depend heavily on the peer. The peer object for a Button, for example, contains platform-dependent code to hook into the native GUI Windows button-drawing code, whereas the AWT button object would be identical for all platforms. The same Java program may behave quite differently on different platforms, following the maxim, when in Rome do as the Romans.

In Swing, there is no peer native gui object for each Component, just a peer object for the entire application, which Swing then manages totally like a giant Canvas, displaying the various components on it all on its own.


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/peer.html J:\mindprod\jgloss\peer.html
logofeedback Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email If you want your message kept confidential, not considered for posting, please explicitly specify that.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.211]
You are visitor number 10,440.