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
logo
Please email your , 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, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.212]
You are visitor number 10,601.