File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
visualvm/heapviewer/src/com/sun/tools/visualvm/heapviewer/swing Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -56,15 +56,23 @@ public HTMLTextComponent(String text) {
56
56
57
57
public void addNotify () {
58
58
super .addNotify ();
59
- if (neverDisplayed ) addHierarchyListener (new HierarchyListener () {
60
- public void hierarchyChanged (HierarchyEvent e ) {
61
- if ((e .getChangeFlags () & HierarchyEvent .SHOWING_CHANGED ) != 0 && HTMLTextComponent .this .isShowing ()) {
62
- neverDisplayed = false ;
63
- HTMLTextComponent .this .removeHierarchyListener (this );
64
- HTMLTextComponent .this .firstDisplayed ();
65
- }
59
+
60
+ if (neverDisplayed ) {
61
+ if (isShowing ()) {
62
+ neverDisplayed = false ;
63
+ firstDisplayed ();
64
+ } else {
65
+ addHierarchyListener (new HierarchyListener () {
66
+ public void hierarchyChanged (HierarchyEvent e ) {
67
+ if ((e .getChangeFlags () & HierarchyEvent .SHOWING_CHANGED ) != 0 && HTMLTextComponent .this .isShowing ()) {
68
+ neverDisplayed = false ;
69
+ HTMLTextComponent .this .removeHierarchyListener (this );
70
+ HTMLTextComponent .this .firstDisplayed ();
71
+ }
72
+ }
73
+ });
66
74
}
67
- });
75
+ }
68
76
}
69
77
70
78
public final boolean neverDisplayed () {
You can’t perform that action at this time.
0 commit comments