src/java.desktop/share/classes/java/awt/Window.java

Print this page




 743         }
 744         setIconImages(imageList);
 745     }
 746 
 747     /**
 748      * Makes this Window displayable by creating the connection to its
 749      * native screen resource.
 750      * This method is called internally by the toolkit and should
 751      * not be called directly by programs.
 752      * @see Component#isDisplayable
 753      * @see Container#removeNotify
 754      * @since 1.0
 755      */
 756     public void addNotify() {
 757         synchronized (getTreeLock()) {
 758             Container parent = this.parent;
 759             if (parent != null && parent.peer == null) {
 760                 parent.addNotify();
 761             }
 762             if (peer == null) {
 763                 peer = getToolkit().createWindow(this);
 764             }
 765             synchronized (allWindows) {
 766                 allWindows.add(this);
 767             }
 768             super.addNotify();
 769         }
 770     }
 771 
 772     /**
 773      * {@inheritDoc}
 774      */
 775     public void removeNotify() {
 776         synchronized (getTreeLock()) {
 777             synchronized (allWindows) {
 778                 allWindows.remove(this);
 779             }
 780             super.removeNotify();
 781         }
 782     }
 783 




 743         }
 744         setIconImages(imageList);
 745     }
 746 
 747     /**
 748      * Makes this Window displayable by creating the connection to its
 749      * native screen resource.
 750      * This method is called internally by the toolkit and should
 751      * not be called directly by programs.
 752      * @see Component#isDisplayable
 753      * @see Container#removeNotify
 754      * @since 1.0
 755      */
 756     public void addNotify() {
 757         synchronized (getTreeLock()) {
 758             Container parent = this.parent;
 759             if (parent != null && parent.peer == null) {
 760                 parent.addNotify();
 761             }
 762             if (peer == null) {
 763                 peer = getComponentFactory().createWindow(this);
 764             }
 765             synchronized (allWindows) {
 766                 allWindows.add(this);
 767             }
 768             super.addNotify();
 769         }
 770     }
 771 
 772     /**
 773      * {@inheritDoc}
 774      */
 775     public void removeNotify() {
 776         synchronized (getTreeLock()) {
 777             synchronized (allWindows) {
 778                 allWindows.remove(this);
 779             }
 780             super.removeNotify();
 781         }
 782     }
 783