/** * Creates the Scrollbar's peer. The peer allows you to modify the appearance of the Scrollbar * without changing any of its functionality. */ public void addNotify() { synchronized (getTreeLock()) { if (peer == null) peer = ((PeerBasedToolkit) getToolkit()).createScrollbar(this); super.addNotify(); } }
/** * Creates the peer of the button. The button's peer allows the application to change the look of * the button without changing its functionality. * * @see java.awt.Toolkit#createButton(java.awt.Button) * @see java.awt.Component#getToolkit() */ public void addNotify() { synchronized (getTreeLock()) { if (peer == null) peer = getToolkit().createButton(this); super.addNotify(); } }