901 |
if (currentPeer != null) |
if (currentPeer != null) |
902 |
currentPeer.setVisible(true); |
currentPeer.setVisible(true); |
903 |
|
|
904 |
|
// The JDK repaints the component before invalidating the parent. |
905 |
|
// So do we. |
906 |
|
repaint(); |
907 |
// Invalidate the parent if we have one. The component itself must |
// Invalidate the parent if we have one. The component itself must |
908 |
// not be invalidated. We also avoid NullPointerException with |
// not be invalidated. We also avoid NullPointerException with |
909 |
// a local reference here. |
// a local reference here. |
910 |
Container currentParent = parent; |
Container currentParent = parent; |
911 |
if (currentParent != null) |
if (currentParent != null) |
912 |
{ |
currentParent.invalidate(); |
|
currentParent.invalidate(); |
|
|
currentParent.repaint(); |
|
|
} |
|
913 |
|
|
914 |
ComponentEvent ce = |
ComponentEvent ce = |
915 |
new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN); |
new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN); |
947 |
currentPeer.setVisible(false); |
currentPeer.setVisible(false); |
948 |
|
|
949 |
this.visible = false; |
this.visible = false; |
950 |
|
|
951 |
|
// The JDK repaints the component before invalidating the parent. |
952 |
|
// So do we. |
953 |
|
repaint(); |
954 |
// Invalidate the parent if we have one. The component itself must |
// Invalidate the parent if we have one. The component itself must |
955 |
// not be invalidated. We also avoid NullPointerException with |
// not be invalidated. We also avoid NullPointerException with |
956 |
// a local reference here. |
// a local reference here. |
957 |
Container currentParent = parent; |
Container currentParent = parent; |
958 |
if (currentParent != null) |
if (currentParent != null) |
959 |
{ |
currentParent.invalidate(); |
|
currentParent.invalidate(); |
|
|
currentParent.repaint(); |
|
|
} |
|
960 |
|
|
961 |
ComponentEvent ce = |
ComponentEvent ce = |
962 |
new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN); |
new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN); |