Skip to content

Commit 2d37b70

Browse files
jisedlacthurka
authored andcommitted
Polishing UI when loading a heap dump
1 parent b129d50 commit 2d37b70

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

visualvm/heapviewer/src/com/sun/tools/visualvm/heapviewer/ui/HeapViewerComponent.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import java.util.Comparator;
4141
import java.util.Set;
4242
import java.util.TreeSet;
43-
import javax.swing.BorderFactory;
4443
import javax.swing.ButtonGroup;
4544
import javax.swing.Icon;
4645
import javax.swing.JComponent;
@@ -67,7 +66,7 @@
6766
* @author Jiri Sedlacek
6867
*/
6968
@NbBundle.Messages({
70-
"HeapViewerComponent_LoadingProgress=Loading heap dump..."
69+
"HeapViewerComponent_LoadingProgress=Opening heap dump..."
7170
})
7271
public final class HeapViewerComponent extends JPanel {
7372

@@ -79,15 +78,11 @@ public final class HeapViewerComponent extends JPanel {
7978

8079
public HeapViewerComponent(HeapViewer heapViewer) {
8180
super(new BorderLayout());
81+
setOpaque(false);
8282

8383
this.heapViewer = heapViewer;
8484

85-
toolbar = ProfilerToolbar.create(true);
86-
add(toolbar.getComponent(), BorderLayout.NORTH);
87-
88-
JLabel loading = new JLabel(Bundle.HeapViewerComponent_LoadingProgress());
89-
loading.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
90-
toolbar.add(loading);
85+
add(new JLabel(Bundle.HeapViewerComponent_LoadingProgress(), JLabel.CENTER), BorderLayout.CENTER);
9186

9287
new RequestProcessor("HPROF initializer for " + getName()).post(new Runnable() { // NOI18N
9388
public void run() { initImpl(); }
@@ -135,7 +130,7 @@ public int compare(HeapViewerFeature f1, HeapViewerFeature f2) {
135130
}
136131
features[i] = featuresS.toArray(new HeapViewerFeature[0]);
137132
}
138-
133+
139134
SwingUtilities.invokeLater(new Runnable() {
140135
public void run() { initComponents(); }
141136
});
@@ -159,8 +154,10 @@ public int compare(HeapViewerFeature f1, HeapViewerFeature f2) {
159154
private MainView mainView;
160155

161156
private void initComponents() {
162-
// Remove the loading progress
163-
toolbar.remove(0);
157+
removeAll();
158+
159+
toolbar = ProfilerToolbar.create(true);
160+
add(toolbar.getComponent(), BorderLayout.NORTH);
164161

165162
// Reserve space for views toolbars
166163
viewToolbar = ProfilerToolbar.create(false);

0 commit comments

Comments
 (0)